[Element][DOM] Set classDependencies before returning

pull/3236/head
Umang Galaiya 6 years ago
parent c3bcee8b70
commit a61f594791

@ -538,15 +538,19 @@ export default class ElementWrapper extends Wrapper {
} }
addAttributes(block: Block) { addAttributes(block: Block) {
// Get all the class dependencies first
this.attributes.forEach((attribute: Attribute) => {
if (attribute.node.name === 'class' && attribute.node.isDynamic) {
this.classDependencies.push(...attribute.node.dependencies);
}
});
if (this.node.attributes.find(attr => attr.type === 'Spread')) { if (this.node.attributes.find(attr => attr.type === 'Spread')) {
this.addSpreadAttributes(block); this.addSpreadAttributes(block);
return; return;
} }
this.attributes.forEach((attribute: Attribute) => { this.attributes.forEach((attribute: Attribute) => {
if (attribute.node.name === 'class' && attribute.node.isDynamic) {
this.classDependencies.push(...attribute.node.dependencies);
}
attribute.render(block); attribute.render(block);
}); });
} }
@ -934,4 +938,4 @@ export default class ElementWrapper extends Wrapper {
); );
} }
} }
} }

Loading…
Cancel
Save