mirror of
https://github.com/node-red/node-red.git
synced 2023-10-10 13:36:53 +02:00
Track mouse release outside workspace so current action completes
This commit is contained in:
parent
deb9c4ecc0
commit
a16032a8ed
@ -230,6 +230,7 @@ RED.view = (function() {
|
||||
.on("mousedown", canvasMouseDown)
|
||||
.on("mouseup", canvasMouseUp)
|
||||
.on("mouseenter", function() {
|
||||
d3.select(document).on('mouseup.red-ui-workspace-tracker', null)
|
||||
if (lasso) {
|
||||
if (d3.event.buttons !== 1) {
|
||||
lasso.remove();
|
||||
@ -245,6 +246,7 @@ RED.view = (function() {
|
||||
}
|
||||
}
|
||||
})
|
||||
.on("mouseleave", canvasMouseLeave)
|
||||
.on("touchend", function() {
|
||||
d3.event.preventDefault();
|
||||
clearTimeout(touchStartTime);
|
||||
@ -1719,7 +1721,14 @@ RED.view = (function() {
|
||||
redraw();
|
||||
}
|
||||
}
|
||||
|
||||
function canvasMouseLeave() {
|
||||
if (mouse_mode !== 0 && d3.event.buttons !== 0) {
|
||||
d3.select(document).on('mouseup.red-ui-workspace-tracker', function() {
|
||||
d3.select(document).on('mouseup.red-ui-workspace-tracker', null)
|
||||
canvasMouseUp.call(this)
|
||||
})
|
||||
}
|
||||
}
|
||||
function canvasMouseUp() {
|
||||
lastClickPosition = [d3.event.offsetX/scaleFactor,d3.event.offsetY/scaleFactor];
|
||||
if (RED.view.DEBUG) {
|
||||
|
Loading…
Reference in New Issue
Block a user