bem / bem-bl

Base BEM library
http://bem.github.com/bem-bl/
198 stars 84 forks source link

Confusing method in default js file #103

Closed vtambourine closed 9 years ago

vtambourine commented 12 years ago

Due to the blocks-common/i-bem/bem/techs/js.js all files in js technology are created with declared empty live method by default. This is quite confusing behaviour, because I have to intentionally remove this declaration to prevent it from overwriting block initialization on creation by bemjson file.

I convinced, this code should be wrapped by some comments.

varya commented 12 years ago

This is because we strongly recommend to use live methods. In fact, very few blocks in our internal library really do not need this method. Let's ask Dmitry what he thinks.

vtambourine commented 12 years ago

Let's say I have the b-stage block, which has to cut itself into tiles, depending on parameters. I declare b-stage in bemjson template and it is only DOM block I need. I expect it to run immediately, running a loop and calling multiple b-tiles. The only way to use live method is to bind to DOM ready event or something like that. That seems to me quite redundantly. Can you please tell me am I wrong?

varya commented 12 years ago

I think the best decision is not removing this live section but commented it. Thank you!

deeonis commented 9 years ago

Неактуально за давностью лет