bem / bem-core

BEM Core Library
https://ru.bem.info/technologies/classic/i-bem/
Other
275 stars 95 forks source link

BemDomEntity. Static method for init entity on dom (v4-5) #1596

Open belozer opened 6 years ago

belozer commented 6 years ago

static method: findOn

findOn(node: BemDomEntity|Element|NodeList|HTMLCollection): ?BemDomEntity

example Link.findOn(domNodes); Link.findOn(this._elem('link'));

current bemDom.getEntity(domNodes, Link); this._elem('link').findMixedBlock(Link);

From history v3 and old versions this.findBlockOn('link', 'link');

@veged @tadatuta

upd Example with _events

this._events(Button); this._events(Button.findOn(this._elem('add-address')));

vs this._events(Button); this._events(this._elem('add-address').findMixedBlock(Button));