[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) {
// 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')) {
this.addSpreadAttributes(block);
return;
}
this.attributes.forEach((attribute: Attribute) => {
if (attribute.node.name === 'class' && attribute.node.isDynamic) {
this.classDependencies.push(...attribute.node.dependencies);
}
attribute.render(block);
});
}
@ -934,4 +938,4 @@ export default class ElementWrapper extends Wrapper {
);
}
}
}
}

Loading…
Cancel
Save