fix certain branches' data-cast not working
This commit is contained in:
parent
0e16a3c528
commit
56a0bbabe5
|
@ -70,6 +70,9 @@ let mutationObserver = new MutationObserver(records => {
|
||||||
// NOTE: Added nodes may contain children which also need to be processed.
|
// NOTE: Added nodes may contain children which also need to be processed.
|
||||||
// Collect those that have [data-cast] on them and apply spells to them.
|
// Collect those that have [data-cast] on them and apply spells to them.
|
||||||
for (let addedNode of record.addedNodes) {
|
for (let addedNode of record.addedNodes) {
|
||||||
|
if (addedNode.getAttribute("data-cast") != null) {
|
||||||
|
mutatedNodes.add(addedNode);
|
||||||
|
}
|
||||||
addedNode.querySelectorAll("[data-cast]").forEach(element => mutatedNodes.add(element));
|
addedNode.querySelectorAll("[data-cast]").forEach(element => mutatedNodes.add(element));
|
||||||
}
|
}
|
||||||
applySpells(mutatedNodes);
|
applySpells(mutatedNodes);
|
||||||
|
|
Loading…
Reference in a new issue