Skip to content

Commit

Permalink
Close color viewer when widget is deselected.
Browse files Browse the repository at this point in the history
  • Loading branch information
96LawDawg committed Jan 23, 2025
1 parent 3a178c3 commit 4638393
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions client/js/jsonedit.js
Original file line number Diff line number Diff line change
Expand Up @@ -1949,6 +1949,18 @@ function jeSVGColors() {
div.remove();
observer.disconnect();
});

// Close the color viewer if the widget is deselected
const widgetDiv = document.querySelector(`#w_${jeStateNow.id}`);
if (widgetDiv) {
const classObserver = new MutationObserver(() => {
if (!widgetDiv.classList.contains('selectedInEdit')) {
div.remove();
classObserver.disconnect();
}
});
classObserver.observe(widgetDiv, { attributes: true, attributeFilter: ['class'] });
}
}

function jeUpdateMulti() {
Expand Down

0 comments on commit 4638393

Please sign in to comment.