Skip to content

Commit

Permalink
Fix Customizer selector
Browse files Browse the repository at this point in the history
  • Loading branch information
tfedor committed Jun 19, 2024
1 parent 3c2e1a5 commit 774ea14
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
entry[1] = enabled;
entries.set(name, entry);
for (let element of document.querySelectorAll<HTMLElement>(`[as-customizer='${name}']`)) {
for (let element of document.querySelectorAll<HTMLElement>(`[data-as-customizer='${name}']`)) {
element.classList.toggle("esi-shown", enabled);
element.classList.toggle("esi-hidden", !enabled);
}
Expand Down Expand Up @@ -87,12 +87,12 @@
onMount(() => {
init(setup);
// we need to run dynamic separately, because it checks whether [as-customizer] already exists in found nodes
// we need to run dynamic separately, because it checks whether [data-as-customizer] already exists in found nodes
if (dynamicSelector) {
let dynamic: CustomizerSetup = [];
for (const node of document.querySelectorAll<HTMLElement>(dynamicSelector)) {
if (node.closest("[as-customizer]")
|| node.querySelector("[as-customizer]")
if (node.closest("[data-as-customizer]")
|| node.querySelector("[data-as-customizer]")
|| node.style.display === "none"
) {
continue;
Expand Down

0 comments on commit 774ea14

Please sign in to comment.