From af36021b6f46ec7cd5cd19a175912a39a550af19 Mon Sep 17 00:00:00 2001 From: Andras Timar Date: Wed, 6 Dec 2023 20:13:24 +0100 Subject: [PATCH] Do not refresh notebookbar when we start in read-only mode for txt and csv This is a workaround for the bug, when a txt or a csv file was opened, and there were both the classic menu and the menu of the notebookbar at the same time at the top of the window. This bug occurred because regardless of the user's UI mode setting, the read-only mode has the classic menu. The fix also have a side effect, that is better than the original symptom. Now when a txt file is opened, and user starts editing it, the Zotero buttons won't be on the References tab. I think it's a good trade-off, but FIXME. Eventually, when we won't have the classic UI mode any more, this problem would be solved better, for all corner cased (txt. csv, pdf, read-only shares etc.) Signed-off-by: Andras Timar Change-Id: Ic3f95c02a0b75136a0b8069fa8297ed129b63865 --- browser/src/control/Control.Zotero.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/browser/src/control/Control.Zotero.js b/browser/src/control/Control.Zotero.js index cded77798..574231eed 100644 --- a/browser/src/control/Control.Zotero.js +++ b/browser/src/control/Control.Zotero.js @@ -136,7 +136,7 @@ L.Control.Zotero = L.Control.extend({ }, refreshUI: function () { - if (this.map.uiManager.notebookbar) + if (this.map.uiManager.notebookbar && !this.map._shouldStartReadOnly()) this.map.uiManager.refreshNotebookbar(); else this.map.uiManager.refreshMenubar();