From 53184715bc2568440efba79109fc203b2569f93c Mon Sep 17 00:00:00 2001 From: Nick O'Leary Date: Thu, 16 Jun 2022 23:18:02 +0100 Subject: [PATCH] Fix menu padding to handle both icons and submenus Fixes #3683 --- .../editor-client/src/js/ui/common/menu.js | 23 ++++++++++++++++++- .../editor-client/src/sass/dropdownMenu.scss | 14 ++++++++++- 2 files changed, 35 insertions(+), 2 deletions(-) diff --git a/packages/node_modules/@node-red/editor-client/src/js/ui/common/menu.js b/packages/node_modules/@node-red/editor-client/src/js/ui/common/menu.js index 6327f5268..c5b8d1d06 100644 --- a/packages/node_modules/@node-red/editor-client/src/js/ui/common/menu.js +++ b/packages/node_modules/@node-red/editor-client/src/js/ui/common/menu.js @@ -133,6 +133,8 @@ RED.menu = (function() { if (opt.options) { item.addClass("red-ui-menu-dropdown-submenu"+(opt.direction!=='right'?" pull-left":"")); var submenu = $('').appendTo(item); + var hasIcons = false + var hasSubmenus = false for (var i=0;i li > a, & > li > a:focus { display: block; - padding: 4px 20px 4px 12px; + padding: 4px 12px 4px 32px; clear: both; font-weight: normal; line-height: 20px; @@ -58,6 +58,18 @@ & > li.pull-left > a:focus { padding: 4px 12px 4px 32px; } + &.red-ui-menu-dropdown-noicons > li > a, + &.red-ui-menu-dropdown-noicons > li > a:focus { + padding: 4px 12px 4px 12px; + } + + &.red-ui-menu-dropdown-submenus > li > a, + &.red-ui-menu-dropdown-submenus > li > a:focus { + padding-right: 20px; + } + + + & > .active > a, & > .active > a:hover, & > .active > a:focus {