Skip to content

Instantly share code, notes, and snippets.

@alexbaumgertner
Created July 18, 2013 15:28
Show Gist options
  • Save alexbaumgertner/6030272 to your computer and use it in GitHub Desktop.
Save alexbaumgertner/6030272 to your computer and use it in GitHub Desktop.
Вопрос по i-bem
/** @requires BEM */
/** @requires BEM.DOM */
(function(undefined) {
BEM.DOM.decl({ block: 'authorization', modName: 'state', modVal: 'initial'}, {
onSetMod : {
'js' : function() {
this.submitButton = this.findBlockInside({ block: 'button', modName: 'type', modVal: 'submit' });
}
},
setSubmitButtonState: function (enable) {
if (enable === 'yes') {
this.submitButton.setMod('state', 'enabled');
} else {
this.submitButton.setMod('state', 'disabled');
}
}
}, {
/* live : function() {
// set current state
this.liveInitOnBlockInsideEvent('completed', 'signin', function (event, data) {
this.setSubmitButtonState(data);
});
this.liveInitOnBlockInsideEvent('completed', 'signup', function (event, data) {
this.setSubmitButtonState(data);
});
}*/
});
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment