Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

i-bem.bemhtml: use the same object for this.mods and this.ctx.mods #441

Closed
narqo opened this issue Mar 7, 2014 · 0 comments
Closed

i-bem.bemhtml: use the same object for this.mods and this.ctx.mods #441

narqo opened this issue Mar 7, 2014 · 0 comments
Labels

Comments

@narqo
Copy link
Member

narqo commented Mar 7, 2014

use

mods : vBlock? this.ctx.mods || (this.ctx.mods = {}) : this.mods

in i-bem.bemhtml

This will allow us to change mods object within default mod so this changes will reflect node's HTML-classes:

block('b1')(
  default()(function() {
    this.mods.a = 'b';
    applyNext();
  }),
  mod('a', 'b')(function() { return 'beep' })
)

// <div class="b1 b1_a_b">beep</div>
@narqo narqo added the v2 label Mar 7, 2014
narqo pushed a commit that referenced this issue Mar 20, 2014
Use the same object for this.mods and this.ctx.mods within default mode
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant