diff --git a/chrome/content/zotero/xpcom/reader.js b/chrome/content/zotero/xpcom/reader.js index feca05aca8..320c9325b0 100644 --- a/chrome/content/zotero/xpcom/reader.js +++ b/chrome/content/zotero/xpcom/reader.js @@ -365,7 +365,7 @@ class ReaderInstance { return `data:image/svg+xml,`; } - _openTagsPopup(x, y, item) { + _openTagsPopup(item, selector) { let menupopup = this._window.document.createElement('menupopup'); menupopup.className = 'tags-popup'; menupopup.style.minWidth = '300px'; @@ -374,7 +374,8 @@ class ReaderInstance { menupopup.appendChild(tagsbox); tagsbox.setAttribute('flex', '1'); this._popupset.appendChild(menupopup); - menupopup.openPopupAtScreen(x, y, false); + let element = this._iframeWindow.document.querySelector(selector); + menupopup.openPopup(element, 'overlap', 0, 0, true); tagsbox.mode = 'edit'; tagsbox.item = item; if (tagsbox.mode == 'edit' && tagsbox.count == 0) { @@ -537,7 +538,14 @@ class ReaderInstance { }); }); popup.appendChild(menuitem); - popup.openPopupAtScreen(data.x, data.y, true); + + if (data.x) { + popup.openPopupAtScreen(data.x, data.y, true); + } + else if (data.selector) { + let element = this._iframeWindow.document.querySelector(data.selector); + popup.openPopup(element, 'after_start', 0, 0, true); + } } _openColorPopup(data) { @@ -662,12 +670,12 @@ class ReaderInstance { return; } case 'openTagsPopup': { - let { id: key, x, y } = message; + let { id: key, selector } = message; let attachment = Zotero.Items.get(this._itemID); let libraryID = attachment.libraryID; let annotation = Zotero.Items.getByLibraryAndKey(libraryID, key); if (annotation) { - this._openTagsPopup(x, y, annotation); + this._openTagsPopup(annotation, selector); } return; } diff --git a/pdf-reader b/pdf-reader index 13aa2cf7f1..826cce2fa0 160000 --- a/pdf-reader +++ b/pdf-reader @@ -1 +1 @@ -Subproject commit 13aa2cf7f1e23f631d4dd173207741abd44b6510 +Subproject commit 826cce2fa0c754b9de456aa2d52f9bfc95dfd3ba