From 9294c0515c1728e2e86b4d7c5b61d12373f97b10 Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Tue, 16 Jun 2026 15:04:24 -0400 Subject: [PATCH] Move tag selector view settings popup handler out of XHTML --- chrome/content/zotero/zoteroPane.js | 15 +++++++++++++++ chrome/content/zotero/zoteroPane.xhtml | 21 +-------------------- 2 files changed, 16 insertions(+), 20 deletions(-) diff --git a/chrome/content/zotero/zoteroPane.js b/chrome/content/zotero/zoteroPane.js index 1cbbcc316a..78b73438c9 100644 --- a/chrome/content/zotero/zoteroPane.js +++ b/chrome/content/zotero/zoteroPane.js @@ -1712,6 +1712,21 @@ var ZoteroPane = new function () { return !tagSelector.hasAttribute('collapsed') || tagSelector.getAttribute('collapsed') == 'false'; }; + + + this.updateTagSelectorViewSettingsMenu = async function () { + document.getElementById('show-automatic').setAttribute('checked', ZoteroPane.tagSelector.showAutomatic); + document.getElementById('display-all-tags').setAttribute('checked', ZoteroPane.tagSelector.displayAllTags); + document.getElementById('num-selected').label = ZoteroPane.tagSelector.label; + var libraryID = ZoteroPane.tagSelector.libraryID; + var library = Zotero.Libraries.get(libraryID); + // 'Delete Automatic Tags in This Library' is per-library, so disable it when the + // selection spans multiple libraries + var enabled = !ZoteroPane.tagSelector.multiLibrary + && library.editable + && (await Zotero.Tags.getAutomaticInLibrary(libraryID)).length > 0; + document.getElementById('delete-automatic-tags').disabled = !enabled; + }; /* diff --git a/chrome/content/zotero/zoteroPane.xhtml b/chrome/content/zotero/zoteroPane.xhtml index 498225b2bc..51c04e03ae 100644 --- a/chrome/content/zotero/zoteroPane.xhtml +++ b/chrome/content/zotero/zoteroPane.xhtml @@ -1040,26 +1040,7 @@ oncommand="ZoteroPane.tagSelector.openDeletePrompt(); event.stopPropagation();"/> + onpopupshowing="ZoteroPane.updateTagSelectorViewSettingsMenu();">