mirror of
https://github.com/node-red/node-red.git
synced 2023-10-10 13:36:53 +02:00
Merge pull request #3696 from node-red/right-click-menu-fix
Fix clicking on node in workspace to hide context menu
This commit is contained in:
commit
1f5588b803
@ -170,6 +170,7 @@ RED.contextMenu = (function() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
show: show
|
show: show,
|
||||||
|
hide: disposeMenu
|
||||||
}
|
}
|
||||||
})()
|
})()
|
||||||
|
@ -988,6 +988,7 @@ RED.view = (function() {
|
|||||||
if (RED.view.DEBUG) {
|
if (RED.view.DEBUG) {
|
||||||
console.warn("canvasMouseDown", { mouse_mode, point: d3.mouse(this), event: d3.event });
|
console.warn("canvasMouseDown", { mouse_mode, point: d3.mouse(this), event: d3.event });
|
||||||
}
|
}
|
||||||
|
RED.contextMenu.hide();
|
||||||
if (mouse_mode === RED.state.SELECTING_NODE) {
|
if (mouse_mode === RED.state.SELECTING_NODE) {
|
||||||
d3.event.stopPropagation();
|
d3.event.stopPropagation();
|
||||||
return;
|
return;
|
||||||
@ -1779,6 +1780,9 @@ RED.view = (function() {
|
|||||||
}
|
}
|
||||||
var i;
|
var i;
|
||||||
var historyEvent;
|
var historyEvent;
|
||||||
|
if (d3.event.button === 2) {
|
||||||
|
return
|
||||||
|
}
|
||||||
if (mouse_mode === RED.state.PANNING) {
|
if (mouse_mode === RED.state.PANNING) {
|
||||||
resetMouseVars();
|
resetMouseVars();
|
||||||
return
|
return
|
||||||
@ -2903,6 +2907,7 @@ RED.view = (function() {
|
|||||||
|
|
||||||
function portMouseDown(d,portType,portIndex, evt) {
|
function portMouseDown(d,portType,portIndex, evt) {
|
||||||
if (RED.view.DEBUG) { console.warn("portMouseDown", mouse_mode,d,portType,portIndex); }
|
if (RED.view.DEBUG) { console.warn("portMouseDown", mouse_mode,d,portType,portIndex); }
|
||||||
|
RED.contextMenu.hide();
|
||||||
evt = evt || d3.event;
|
evt = evt || d3.event;
|
||||||
if (evt === 1) {
|
if (evt === 1) {
|
||||||
return;
|
return;
|
||||||
@ -3411,6 +3416,7 @@ RED.view = (function() {
|
|||||||
function nodeMouseDown(d) {
|
function nodeMouseDown(d) {
|
||||||
if (RED.view.DEBUG) { console.warn("nodeMouseDown", mouse_mode,d); }
|
if (RED.view.DEBUG) { console.warn("nodeMouseDown", mouse_mode,d); }
|
||||||
focusView();
|
focusView();
|
||||||
|
RED.contextMenu.hide();
|
||||||
if (d3.event.button === 1) {
|
if (d3.event.button === 1) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -3793,6 +3799,7 @@ RED.view = (function() {
|
|||||||
if (RED.view.DEBUG) {
|
if (RED.view.DEBUG) {
|
||||||
console.warn("linkMouseDown", { mouse_mode, point: d3.mouse(this), event: d3.event });
|
console.warn("linkMouseDown", { mouse_mode, point: d3.mouse(this), event: d3.event });
|
||||||
}
|
}
|
||||||
|
RED.contextMenu.hide();
|
||||||
if (mouse_mode === RED.state.SELECTING_NODE) {
|
if (mouse_mode === RED.state.SELECTING_NODE) {
|
||||||
d3.event.stopPropagation();
|
d3.event.stopPropagation();
|
||||||
return;
|
return;
|
||||||
@ -3852,6 +3859,9 @@ RED.view = (function() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function groupMouseUp(g) {
|
function groupMouseUp(g) {
|
||||||
|
if (RED.view.DEBUG) {
|
||||||
|
console.warn("groupMouseUp", { mouse_mode, event: d3.event });
|
||||||
|
}
|
||||||
if (dblClickPrimed && mousedown_group == g && clickElapsed > 0 && clickElapsed < dblClickInterval) {
|
if (dblClickPrimed && mousedown_group == g && clickElapsed > 0 && clickElapsed < dblClickInterval) {
|
||||||
mouse_mode = RED.state.DEFAULT;
|
mouse_mode = RED.state.DEFAULT;
|
||||||
RED.editor.editGroup(g);
|
RED.editor.editGroup(g);
|
||||||
@ -3867,6 +3877,10 @@ RED.view = (function() {
|
|||||||
// return
|
// return
|
||||||
// }
|
// }
|
||||||
|
|
||||||
|
if (RED.view.DEBUG) {
|
||||||
|
console.warn("groupMouseDown", { mouse_mode, point: mouse, event: d3.event });
|
||||||
|
}
|
||||||
|
RED.contextMenu.hide();
|
||||||
focusView();
|
focusView();
|
||||||
if (d3.event.button === 1) {
|
if (d3.event.button === 1) {
|
||||||
return;
|
return;
|
||||||
|
Loading…
Reference in New Issue
Block a user