Skip watching logic if there is no editor on the page

This commit is contained in:
koloml committed 2024-11-12 14:24:04 +04:00
1 parent 5092dc7f6d
commit 3e05b1964d
1 file changed
+5
+5
View File
@@ -199,6 +199,11 @@ export function wrapTagDropdown(element) {
}
export function watchTagDropdownsInTagsEditor() {
// We only need to watch for new editor elements if there is a tag editor present on the page
if (!document.querySelector('#image_tags_and_source')) {
return;
}
document.body.addEventListener('mouseover', event => {
/** @type {HTMLElement} */
const targetElement = event.target;