From 02d64f19d91a44650806800a738519599b36e5b2 Mon Sep 17 00:00:00 2001 From: Skyler Grey Date: Tue, 14 Nov 2023 13:10:01 +0000 Subject: [PATCH] Prevent hiding the menu bar in tabbed mode Tabbed mode doesn't have a menu bar, instead it has tabs. These can't be hidden. Unfortunately, the post messages to hide the menu bar have the side effect of hiding the tabs. This commit prevents the tabs being hidden when in tabbed mode, and shows the tabs again when switching from compact mode into tabbed mode. When switching back from tabbed into compact mode, the state that you would like the menu bar to be in (hidden/shown) will be remembered and restored. This includes any postmessages that were not acted on while in tabbed mode. Signed-off-by: Skyler Grey Change-Id: I1177903fe965e354538e6e7bbc3c83af3177938e --- browser/src/control/Control.UIManager.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/browser/src/control/Control.UIManager.js b/browser/src/control/Control.UIManager.js index 94d059bad..09dcd3e87 100644 --- a/browser/src/control/Control.UIManager.js +++ b/browser/src/control/Control.UIManager.js @@ -429,6 +429,9 @@ L.Control.UIManager = L.Control.extend({ this.map._docLayer._requestNewTiles(); this.map.topToolbar.updateControlsState(); + + if (this._menubarShouldBeHidden) + this.hideMenubar(); }, createNotebookbarControl: function(docType) { @@ -496,6 +499,9 @@ L.Control.UIManager = L.Control.extend({ this.refreshNotebookbar(); this.map._docLayer._resetClientVisArea(); this.map._docLayer._requestNewTiles(); + var menubarWasHidden = this.isMenubarHidden(); + this.showMenubar(); + this._menubarShouldBeHidden = menubarWasHidden; }, removeNotebookbarUI: function() { @@ -663,6 +669,7 @@ L.Control.UIManager = L.Control.extend({ // Menubar showMenubar: function() { + this._menubarShouldBeHidden = false; if (!this.isMenubarHidden()) return; $('.main-nav').show(); @@ -680,7 +687,8 @@ L.Control.UIManager = L.Control.extend({ }, hideMenubar: function() { - if (this.isMenubarHidden()) + this._menubarShouldBeHidden = true; + if (this.isMenubarHidden() || this.shouldUseNotebookbarMode()) return; var notebookbarWasCollapsed = this.isNotebookbarCollapsed();