From 56a0bbabe5b910651d6322620474396b9acca529 Mon Sep 17 00:00:00 2001 From: lqdev Date: Tue, 5 Mar 2024 23:33:27 +0100 Subject: [PATCH] fix certain branches' data-cast not working --- static/js/spells.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/static/js/spells.js b/static/js/spells.js index 1699a5c..5d5236d 100644 --- a/static/js/spells.js +++ b/static/js/spells.js @@ -70,6 +70,9 @@ let mutationObserver = new MutationObserver(records => { // 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. for (let addedNode of record.addedNodes) { + if (addedNode.getAttribute("data-cast") != null) { + mutatedNodes.add(addedNode); + } addedNode.querySelectorAll("[data-cast]").forEach(element => mutatedNodes.add(element)); } applySpells(mutatedNodes);