diff --git a/touch.blocks/ua/__dom/ua__dom.deps.js b/touch.blocks/ua/__dom/ua__dom.deps.js index 6bb4850de..bce103e06 100644 --- a/touch.blocks/ua/__dom/ua__dom.deps.js +++ b/touch.blocks/ua/__dom/ua__dom.deps.js @@ -1,4 +1,3 @@ ({ - mustDeps : 'ua', - shouldDeps : { block : 'i-bem', elem : 'dom' } + mustDeps : ['ua', 'i-bem-dom'] }) diff --git a/touch.blocks/ua/__dom/ua__dom.js b/touch.blocks/ua/__dom/ua__dom.js index 9ef98777d..0a1a44b6e 100644 --- a/touch.blocks/ua/__dom/ua__dom.js +++ b/touch.blocks/ua/__dom/ua__dom.js @@ -2,7 +2,7 @@ * @module ua * @description Use ua module to provide user agent features by modifiers and update some on orient change */ -modules.define('ua', ['i-bem__dom'], function(provide, bemDom, ua) { +modules.define('ua', ['i-bem-dom'], function(provide, bemDom, ua) { provide(/** @exports */bemDom.declBlock(this.name, { diff --git a/touch.blocks/ua/__dom/ua__dom.ru.md b/touch.blocks/ua/__dom/ua__dom.ru.md index e782dbb56..b1497c2b5 100644 --- a/touch.blocks/ua/__dom/ua__dom.ru.md +++ b/touch.blocks/ua/__dom/ua__dom.ru.md @@ -6,13 +6,13 @@ Это позволяет учитывать особенности мобильного устройства, проверяя наличие и значение модификаторов. ```js -modules.define('ios-test', ['i-bem__dom'], function(provide, BEMDOM) { +modules.define('ios-test', ['i-bem-dom', 'ua'], function(provide, bemDom, Ua) { -provide(BEMDOM.decl(this.name, { +provide(bemDom.declBlock(this.name, { onSetMod: { js: { inited: function() { - this.findBlockOutside('ua').hasMod('platform', 'ios') && + this.findParentBlock(Ua).hasMod('platform', 'ios') && this.setMod('ios'); } }, @@ -126,20 +126,19 @@ provide(BEMDOM.decl(this.name, { Значение модификатора изменяется динамически при смене ориентации устройства. Поэтому можно подписываться на изменение значения модификатора: ```js -modules.define('inner', ['i-bem__dom'], function(provide, BEMDOM) { +modules.define('inner', ['i-bem-dom', 'ua'], function(provide, bemDom, Ua) { -provide(BEMDOM.decl(this.name, { +provide(bemDom.declBlock(this.name, { onSetMod: { js: { inited: function() { - this._ua = this - .findBlockOutside('ua') + this._ua = this.findParentBlock(Ua); + + this + ._events(this.ua) .on({ modName : 'orient', modVal : '*' }, this._onOrientChange, this); this.setMod('orient', this._ua.getMod('orient')); - }, - '': function() { - this._ua.un({ modName : 'orient', modVal : '*' }, this._onOrientChange, this); } }, @@ -161,7 +160,7 @@ provide(BEMDOM.decl(this.name, { _reDraw: function(orient) { // обновляем содержимое контейнера `inner` при смене ориентации устройства console.log(orient); - BEMDOM.update(this.domElem, orient); + bemDom.update(this.domElem, orient); } })); diff --git a/touch.blocks/ua/ua.deps.js b/touch.blocks/ua/ua.deps.js new file mode 100644 index 000000000..781b0d791 --- /dev/null +++ b/touch.blocks/ua/ua.deps.js @@ -0,0 +1,3 @@ +({ + shouldDeps : 'jquery' +})