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
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);