From 962c68404fda1bd78e407eda4c44094d40513221 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hubert=20Figui=C3=A8re?= Date: Tue, 24 Dec 2024 11:05:06 -0500 Subject: [PATCH] context menu: Don't show items for hidden commands MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Hubert Figuière Change-Id: I15f62cbdfc69d9ba4c1c7e53f2238d13b65285e5 --- browser/src/control/Control.ContextMenu.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/browser/src/control/Control.ContextMenu.js b/browser/src/control/Control.ContextMenu.js index a32e8d7fe336..aecb8a6fe7d7 100644 --- a/browser/src/control/Control.ContextMenu.js +++ b/browser/src/control/Control.ContextMenu.js @@ -249,6 +249,11 @@ L.Control.ContextMenu = L.Control.extend({ continue; } + // If the command was hidden with the Hide_Command postmessage... + if (this._map.uiManager.hiddenCommands[item.command]) { + continue; + } + // reduce Paste Special submenu if (item.type === 'menu' && item.text && item.text.replace('~', '') === 'Paste Special' && item.menu && item.menu.length) {