Skip to content

Commit

Permalink
reinit js smarter, to prevent doing it multiple times
Browse files Browse the repository at this point in the history
  • Loading branch information
mutantsan committed Jun 18, 2024
1 parent 58b5451 commit f37d02b
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions ckanext/charts/assets/js/charts-global.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,12 @@ ckan.module("charts-global", function ($, _) {
var elements = event.target.querySelectorAll("[data-module]");

for (let node of elements) {
if (node.getAttribute("dm-initialized")) {
continue;
}

ckan.module.initializeElement(node);
node.setAttribute("dm-initialized", true)
}
});
}
Expand Down

0 comments on commit f37d02b

Please sign in to comment.