jquery-bem
jquery-bem copied to clipboard
Lost context on each()
<div class="foo bar"></div>
$('.foo').each(function () {
$(this).mod('modifier', true);
});
Result
<div class="foo bar bar_modifier"></div>
I know, that ctx()
helps in this case, but do you think that it should remember context?
Current context based on selector
property of jQuery object. Inside of each
the selector is lost. You should set context again.
$(this).ctx('foo').mod('modifier', true);
I already know about this issue. But fix will take a long time.
Thanks! Looking forward to the fix.
$(this).ctx('form__input')
or
$(this).block().elem('input')
It looks bad. Why not just use the first class? Maybe just be take from the source code of BEM? Really need this plugin. I sincerely hope for improvement.