From 1b324f9bd10f2b66aa13a41d010c99020e0c2f45 Mon Sep 17 00:00:00 2001 From: Martynas Bagdonas Date: Wed, 8 Jun 2022 21:21:23 +0300 Subject: [PATCH] fx-compat: Fix color rendering in annotation popup, use checkbox --- chrome/content/zotero/xpcom/reader.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/chrome/content/zotero/xpcom/reader.js b/chrome/content/zotero/xpcom/reader.js index d316cfe140..f160feaf09 100644 --- a/chrome/content/zotero/xpcom/reader.js +++ b/chrome/content/zotero/xpcom/reader.js @@ -574,7 +574,8 @@ class ReaderInstance { menuitem.setAttribute('label', Zotero.getString(color[0])); menuitem.className = 'menuitem-iconic'; menuitem.setAttribute('disabled', data.readOnly); - menuitem.setAttribute('image', this._getColorIcon(color[1], color[1] === data.selectedColor)); + menuitem.setAttribute('checked', color[1] === data.selectedColor); + menuitem.setAttribute('image', this._getColorIcon(color[1])); menuitem.addEventListener('command', () => { this._postMessage({ action: 'popupCmd', @@ -633,7 +634,7 @@ class ReaderInstance { popup.appendChild(menuitem); if (data.x) { - popup.openPopupAtScreen(data.x, data.y, true); + popup.openPopupAtScreen(data.x, data.y, false); } else if (data.selector) { let element = this._iframeWindow.document.querySelector(data.selector); @@ -652,7 +653,8 @@ class ReaderInstance { menuitem = this._window.document.createXULElement('menuitem'); menuitem.setAttribute('label', Zotero.getString(color[0])); menuitem.className = 'menuitem-iconic'; - menuitem.setAttribute('image', this._getColorIcon(color[1], color[1] === data.selectedColor)); + menuitem.setAttribute('checked', color[1] === data.selectedColor); + menuitem.setAttribute('image', this._getColorIcon(color[1])); menuitem.addEventListener('command', () => { this._postMessage({ action: 'popupCmd',