Skip to content

Instantly share code, notes, and snippets.

@narqo
Created December 18, 2013 17:26
Show Gist options
  • Save narqo/8026317 to your computer and use it in GitHub Desktop.
Save narqo/8026317 to your computer and use it in GitHub Desktop.
/*borschik:include:i-bem.js*/;
modules.require(['i-bem'], function(BEM) {
BEM.decl('block1', {
method1 : function() {
console.log('m1');
}
});
BEM.decl({ block : 'block1', modName : 'm1', modVal : 'v1' }, {
method1 : function() {
console.log('m2');
}
});
BEM.decl('block2', {
onSetMod : {
js : {
inited : function() {
var b1 = BEM.create({ block : 'block1', mods : { m1 : 'v1' } });
b1.method1();
b1.delMod('m1');
b1.method1();
}
}
}
});
BEM.create('block2');
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment