diff --git a/chrome/content/zotero/components/editable.jsx b/chrome/content/zotero/components/editable.jsx index eb170f9110..bf6f6627a0 100644 --- a/chrome/content/zotero/components/editable.jsx +++ b/chrome/content/zotero/components/editable.jsx @@ -80,10 +80,10 @@ class Editable extends React.PureComponent { } render() { - const { isDisabled } = this.props; + const { isDisabled, isReadOnly } = this.props; return (
this.props.onClick(event) } onFocus={ event => this.props.onFocus(event) } onMouseDown={ event => this.props.onMouseDown(event) } diff --git a/chrome/content/zotero/components/itemPane/tagsBox.jsx b/chrome/content/zotero/components/itemPane/tagsBox.jsx index 09672acb11..9e20af4d6f 100644 --- a/chrome/content/zotero/components/itemPane/tagsBox.jsx +++ b/chrome/content/zotero/components/itemPane/tagsBox.jsx @@ -85,6 +85,9 @@ const TagsBox = React.forwardRef((props, ref) => { } function handleEdit(event) { + if (!props.editable) { + return; + } if (skipNextEdit.current) { skipNextEdit.current = false; return; @@ -349,13 +352,13 @@ const TagsBox = React.forwardRef((props, ref) => { title={title} tooltiptext={title} style={{ width: "16px", height: "16px" }} - onClick={() => setSelectedTag(tag.tag)} + onClick={props.editable ? (() => setSelectedTag(tag.tag)) : undefined} />
{
{renderCount()}
-
+ { props.editable &&
}
    {displayTags.map(tag => renderTagRow(tag))}
- + /> }
); diff --git a/chrome/content/zotero/containers/tagsBox.xul b/chrome/content/zotero/containers/tagsBox.xul index ad1a4065a1..ff69329398 100644 --- a/chrome/content/zotero/containers/tagsBox.xul +++ b/chrome/content/zotero/containers/tagsBox.xul @@ -30,7 +30,8 @@ - + diff --git a/chrome/content/zotero/itemPane.js b/chrome/content/zotero/itemPane.js index d21d4d12e0..7bb2c24e07 100644 --- a/chrome/content/zotero/itemPane.js +++ b/chrome/content/zotero/itemPane.js @@ -324,6 +324,13 @@ var ZoteroItemPane = new function() { } + this.onTagsContextPopupShowing = function () { + if (!_lastItem.editable) { + return false; + } + } + + this.removeAllTags = async function () { if (Services.prompt.confirm(null, "", Zotero.getString('pane.item.tags.removeAll'))) { _lastItem.setTags([]);