Restore disabling of automatic tag deletion option when no such tags

This commit is contained in:
Dan Stillman 2019-03-07 04:08:45 -05:00
parent 85c6ec0ca4
commit c7698a2324
2 changed files with 13 additions and 2 deletions

View file

@ -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}
/>;
}

View file

@ -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;
})();">
<menuitem id="num-selected" disabled="true"/>
<menuitem id="deselect-all" label="&zotero.tagSelector.clearAll;"
oncommand="ZoteroPane.tagSelector.deselectAll(); event.stopPropagation();"/>