From ac255634c5f507efe3f54b139928348589b575e9 Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Mon, 23 Sep 2019 20:09:26 -0400 Subject: [PATCH] Fix tag selection in read-only libraries Reactification mistakenly disabled tag selection instead of just disabling the context menu options. --- chrome/content/zotero/containers/tagSelector.jsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/chrome/content/zotero/containers/tagSelector.jsx b/chrome/content/zotero/containers/tagSelector.jsx index ed6ca94408..48f813a2f6 100644 --- a/chrome/content/zotero/containers/tagSelector.jsx +++ b/chrome/content/zotero/containers/tagSelector.jsx @@ -451,7 +451,7 @@ Zotero.TagSelector = class TagSelectorContainer extends React.PureComponent { tagListRef={this.tagListRef} searchString={this.state.searchString} dragObserver={this.dragObserver} - onSelect={this.state.viewOnly ? () => {} : this.handleTagSelected} + onSelect={this.handleTagSelected} onTagContext={this.handleTagContext} onSearch={this.handleSearch} onSettings={this.handleSettings.bind(this)} @@ -468,6 +468,10 @@ Zotero.TagSelector = class TagSelectorContainer extends React.PureComponent { handleTagContext = (tag, ev) => { let tagContextMenu = document.getElementById('tag-menu'); + // Disable menu options in read-only mode + for (let i = 0; i < tagContextMenu.childNodes.length; i++) { + tagContextMenu.childNodes[i].disabled = this.state.viewOnly; + } ev.preventDefault(); tagContextMenu.openPopup(null, null, ev.clientX+2, ev.clientY+2); this.contextTag = tag;