diff --git a/chrome/content/zotero/containers/tagSelector.jsx b/chrome/content/zotero/containers/tagSelector.jsx index 3548fa3a21..efb0a2dd6b 100644 --- a/chrome/content/zotero/containers/tagSelector.jsx +++ b/chrome/content/zotero/containers/tagSelector.jsx @@ -159,7 +159,7 @@ Zotero.TagSelector = class TagSelectorContainer extends React.Component { onSelect={this.state.viewOnly ? () => {} : this.handleTagSelected} onTagContext={this.handleTagContext} onSearch={this.handleSearch} - onSettings={this.handleSettings} + onSettings={this.handleSettings.bind(this)} loaded={this.state.loaded} />; } diff --git a/chrome/content/zotero/containers/tagSelector.xul b/chrome/content/zotero/containers/tagSelector.xul index d84e384080..f056b539fa 100644 --- a/chrome/content/zotero/containers/tagSelector.xul +++ b/chrome/content/zotero/containers/tagSelector.xul @@ -41,7 +41,18 @@ onpopupshowing=" 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"> + document.getElementById('num-selected').label = ZoteroPane.tagSelector.label; + (async function () { + var libraryID = ZoteroPane.tagSelector.libraryID; + var library = Zotero.Libraries.get(libraryID); + var enabled = false; + if (library.editable) { + if ((await Zotero.Tags.getAutomaticInLibrary(libraryID)).length) { + enabled = true; + } + } + document.getElementById('delete-automatic-tags').disabled = !enabled; + })();">