Merge branch 'master' into pr_3744

This commit is contained in:
Nick O'Leary 2022-07-08 13:08:26 +01:00 committed by GitHub
commit 241b47fe19
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 75 additions and 75 deletions

View File

@ -15,10 +15,6 @@ RED.contextMenu = (function() {
// ],
// width: 200,
// })
}
function disposeMenu() {
@ -103,7 +99,7 @@ RED.contextMenu = (function() {
{
label: RED._("contextMenu.linkNodes"),
onselect: 'core:split-wire-with-link-nodes',
disabled: hasSelection || !hasLinks
disabled: !hasLinks
}
]
@ -111,22 +107,7 @@ RED.contextMenu = (function() {
}
]
// menuItems.push(
// {
// label: (isSingleLink || isMultipleLinks)?'Insert into wire...':'Add node...',
// onselect: function() {
// RED.view.showQuickAddDialog({
// position: [ options.x - offset.left, options.y - offset.top ],
// touchTrigger: true,
// splice: isSingleLink?selection.links[0]:undefined,
// spliceMultiple: isMultipleLinks
// })
// }
// },
// )
// if (hasLinks && !hasSelection) {
// menuItems.push({ onselect: 'core:split-wires-with-junctions', label: 'Insert junction'})
// }
menuItems.push(
null,
{ onselect: 'core:undo', disabled: RED.history.list().length === 0 },
@ -200,16 +181,17 @@ RED.contextMenu = (function() {
disposeMenu()
});
menu.show();
// menu.show({
// target: $('#red-ui-main-container'),
// x: options.x,
// y: options.y
// })
// set focus to first item so that pressing escape key closes the menu
$("#red-ui-workspace-context-menu :first(ul) > a").trigger("focus")
}
// Allow escape key hook and other editor events to close context menu
RED.keyboard.add("red-ui-workspace-context-menu", "escape", function () { RED.contextMenu.hide() })
RED.events.on("editor:open", function () { RED.contextMenu.hide() });
RED.events.on("search:open", function () { RED.contextMenu.hide() });
RED.events.on("type-search:open", function () { RED.contextMenu.hide() });
RED.events.on("actionList:open", function () { RED.contextMenu.hide() });
RED.events.on("view:selection-changed", function () { RED.contextMenu.hide() });
return {
show: show,
hide: disposeMenu

View File

@ -3293,11 +3293,17 @@ RED.view = (function() {
if (active && ((portType === PORT_TYPE_INPUT && ((d._def && d._def.inputLabels)||d.inputLabels)) || (portType === PORT_TYPE_OUTPUT && ((d._def && d._def.outputLabels)||d.outputLabels)))) {
portLabelHoverTimeout = setTimeout(function() {
const n = port && port.node()
const nId = n && n.__data__ && n.__data__.id
//check see if node has been deleted since timeout started
if(!n || !n.parentNode || !RED.nodes.node(n.__data__.id)) {
return; //node is gone!
}
var tooltip = getPortLabel(d,portType,portIndex);
if (!tooltip) {
return;
}
var pos = getElementPosition(port.node());
var pos = getElementPosition(n);
portLabelHoverTimeout = null;
portLabelHover = showTooltip(
(pos[0]+(portType===PORT_TYPE_INPUT?-2:12)),
@ -3734,6 +3740,10 @@ RED.view = (function() {
if (d.hasOwnProperty('l')?!d.l : (d.type === "link in" || d.type === "link out")) {
var parentNode = this.parentNode;
portLabelHoverTimeout = setTimeout(function() {
//check see if node has been deleted since timeout started
if(!parentNode || !parentNode.parentNode || !RED.nodes.node(parentNode.id)) {
return; //node is gone!
}
var tooltip;
if (d._def.label) {
tooltip = d._def.label;

View File

@ -459,14 +459,19 @@ RED.debug = (function() {
function showMessageMenu(button,dbgMessage,sourceId) {
activeMenuMessage = dbgMessage;
if (!menuOptionMenu) {
menuOptionMenu = RED.menu.init({id:"red-ui-debug-msg-option-menu",
options: [
var opts = [
{id:"red-ui-debug-msg-menu-item-collapse",label:RED._("node-red:debug.messageMenu.collapseAll"),onselect:function(){
activeMenuMessage.collapse();
}},
];
if (activeMenuMessage.clearPinned) {
opts.push(
{id:"red-ui-debug-msg-menu-item-clear-pins",label:RED._("node-red:debug.messageMenu.clearPinned"),onselect:function(){
activeMenuMessage.clearPinned();
}},
);
}
opts.push(
null,
{id:"red-ui-debug-msg-menu-item-filter", label:RED._("node-red:debug.messageMenu.filterNode"),onselect:function(){
var candidateNodes = RED.nodes.filterNodes({type:'debug'});
@ -482,7 +487,10 @@ RED.debug = (function() {
$("#red-ui-sidebar-debug-filterAll").trigger("click");
refreshMessageList();
}}
]
);
menuOptionMenu = RED.menu.init({id:"red-ui-debug-msg-option-menu",
options: opts
});
menuOptionMenu.css({
position: "absolute"