Skip to content

Commit 876842c

Browse files
committed
Display highlight popup in the web build. zotero/web-library#570
1 parent 0f15a7f commit 876842c

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

src/ui/editor.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ function Editor(props) {
7878
{refReady && !props.disableUI && <Fragment>
7979
{['ios', 'web'].includes(props.viewMode) && !editorState.link?.popup.active && editorState.table.isTableSelected() && <TablePopup parentRef={editorRef} tableState={editorState.table} /> }
8080
{editorState.link && <LinkPopup parentRef={editorRef} pluginState={editorState.link.popup}/>}
81-
{!['web'].includes(props.viewMode) && editorState.highlight && <HighlightPopup parentRef={editorRef} highlightState={editorState.highlight} citationState={editorState.citation}/>}
81+
{editorState.highlight && <HighlightPopup parentRef={editorRef} highlightState={editorState.highlight} citationState={editorState.citation} viewMode={props.viewMode} />}
8282
{!['web'].includes(props.viewMode) && editorState.image && <ImagePopup parentRef={editorRef} imageState={editorState.image} citationState={editorState.citation}/>}
8383
{editorState.citation && <CitationPopup
8484
parentRef={editorRef}

src/ui/popups/highlight-popup.js

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import IconBlockquote from '../../../res/icons/16/cite.svg';
99
import IconDocument from '../../../res/icons/16/page.svg';
1010
import IconUnlink from '../../../res/icons/16/unlink.svg';
1111

12-
function HighlightPopup({ parentRef, highlightState, citationState }) {
12+
function HighlightPopup({ parentRef, highlightState, citationState, viewMode }) {
1313
function handleOpen() {
1414
highlightState.popup.open();
1515
}
@@ -28,10 +28,12 @@ function HighlightPopup({ parentRef, highlightState, citationState }) {
2828
<div className="icon"><IconDocument/></div>
2929
<div className="title"><FormattedMessage id="noteEditor.showOnPage"/></div>
3030
</button>
31-
<button onClick={handleUnlink}>
32-
<div className="icon"><IconUnlink/></div>
33-
<div className="title"><FormattedMessage id="noteEditor.unlink"/></div>
34-
</button>
31+
{!['web'].includes(viewMode) && (
32+
<button onClick={handleUnlink}>
33+
<div className="icon"><IconUnlink/></div>
34+
<div className="title"><FormattedMessage id="noteEditor.unlink"/></div>
35+
</button>
36+
)}
3537
{citationState.canAddCitationAfter() && <button onClick={handleAdd}>
3638
<div className="icon"><IconBlockquote/></div>
3739
<div className="title"><FormattedMessage id="noteEditor.addCitation"/></div>

0 commit comments

Comments
 (0)