Fix menu shortcut display when menu label is long

This commit is contained in:
Nick O'Leary 2021-09-24 19:44:05 +01:00
parent c2625d696d
commit 6ab74951f4
No known key found for this signature in database
GPG Key ID: 4F2157149161A6C9
5 changed files with 11 additions and 10 deletions

View File

@ -82,7 +82,7 @@ RED.menu = (function() {
linkContent += '<span class="red-ui-menu-label-container"><span class="red-ui-menu-label">'+opt.label+'</span>'+
'<span class="red-ui-menu-sublabel">'+opt.sublabel+'</span></span>'
} else {
linkContent += '<span class="red-ui-menu-label">'+opt.label+'</span>'
linkContent += '<span class="red-ui-menu-label"><span>'+opt.label+'</span></span>'
}
linkContent += '</a>';
@ -92,7 +92,7 @@ RED.menu = (function() {
if (typeof opt.onselect === 'string') {
var shortcut = RED.keyboard.getShortcut(opt.onselect);
if (shortcut && shortcut.key) {
opt.shortcutSpan = $('<span class="red-ui-popover-key">'+RED.keyboard.formatKey(shortcut.key, true)+'</span>').appendTo(link);
opt.shortcutSpan = $('<span class="red-ui-popover-key">'+RED.keyboard.formatKey(shortcut.key, true)+'</span>').appendTo(link.find(".red-ui-menu-label"));
}
}

View File

@ -686,7 +686,7 @@ RED.view = (function() {
});
activeGroups = RED.nodes.groups(activeWorkspace)||[];
activeGroups.forEach(function(g) {
activeGroups.forEach(function(g, i) {
g._index = i;
if (g.g) {
g._root = g.g;

View File

@ -24,10 +24,6 @@ RED.workspaces = (function() {
var hideStack = [];
var viewStackPos = 0;
function isSameObj(env0, env1) {
return (JSON.stringify(env0) === JSON.stringify(env1));
}
function addToViewStack(id) {
if (viewStackPos !== viewStack.length) {
viewStack.splice(viewStackPos);

View File

@ -46,7 +46,7 @@
& > li > a,
& > li > a:focus {
display: block;
padding: 4px 0 4px 32px;
padding: 4px 12px 4px 32px;
clear: both;
font-weight: normal;
line-height: 20px;
@ -106,11 +106,17 @@
display: none;
}
}
.red-ui-menu-label {
display: flex;
& > :first-child {
flex-grow: 1
}
}
.red-ui-popover-key {
border: none;
padding: 0;
font-size: 13px;
float: right;
// float: right;
color: $menuColor;
border-color: $menuColor;
}

View File

@ -214,7 +214,6 @@
}
span.red-ui-menu-label {
font-size: 14px;
display: inline-block;
text-indent: 0px;
}
span.red-ui-menu-sublabel {