From 51eb087cee9704ea946fd06dc8e4ded2a901f191 Mon Sep 17 00:00:00 2001 From: Dmitry Filatov Date: Thu, 2 Aug 2012 12:09:19 +0400 Subject: [PATCH] =?UTF-8?q?=D0=9D=D0=B5=D0=BF=D1=80=D0=B0=D0=B2=D0=B8?= =?UTF-8?q?=D0=BB=D1=8C=D0=BD=D1=8B=D0=B9=20extend=20=D0=BF=D0=B0=D1=80?= =?UTF-8?q?=D0=B0=D0=BC=D0=B5=D1=82=D1=80=D0=BE=D0=B2=20=D0=B2=20=D0=B1?= =?UTF-8?q?=D0=BB=D0=BE=D0=BA=D0=B5=20=D0=BD=D0=B0=20=D0=BD=D0=B5=D1=81?= =?UTF-8?q?=D0=BA=D0=BE=D0=BB=D1=8C=D0=BA=D0=B8=D1=85=20=D0=BD=D0=BE=D0=B4?= =?UTF-8?q?=D0=B0=D1=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- blocks-common/i-bem/__dom/i-bem__dom.js | 2 +- blocks-common/i-bem/i-bem.js | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/blocks-common/i-bem/__dom/i-bem__dom.js b/blocks-common/i-bem/__dom/i-bem__dom.js index 70455bc3..52695823 100644 --- a/blocks-common/i-bem/__dom/i-bem__dom.js +++ b/blocks-common/i-bem/__dom/i-bem__dom.js @@ -69,7 +69,7 @@ function init(domElem, uniqInitId) { if(block) { if(block.domElem.index(domNode) < 0) { block.domElem = block.domElem.add(domElem); - $.extend(block.params, params); + $.extend(block._params, params); } } else { initBlock(blockName, domElem, params); diff --git a/blocks-common/i-bem/i-bem.js b/blocks-common/i-bem/i-bem.js index b6a0cb9e..ca8947fd 100644 --- a/blocks-common/i-bem/i-bem.js +++ b/blocks-common/i-bem/i-bem.js @@ -121,10 +121,11 @@ this.BEM = $.inherit($.observable, /** @lends BEM.prototype */ { * @protected * @type Object */ + _this._params = params; // это нужно для правильной сборки параметров у блока из нескольких нод _this.params = null; initImmediately !== false? - _this._init(params) : + _this._init() : _this.afterCurrentEvent(function() { _this._init(params); }); @@ -135,10 +136,11 @@ this.BEM = $.inherit($.observable, /** @lends BEM.prototype */ { * Инициализирует блок * @private */ - _init : function(params) { + _init : function() { if(!this.hasMod('js', 'inited')) { - this.params = $.extend(this.getDefaultParams(), params); + this.params = $.extend(this.getDefaultParams(), this._params); + delete this._params; this .setMod('js', 'inited') .trigger('init');