1
0
mirror of https://github.com/node-red/node-red.git synced 2023-10-10 13:36:53 +02:00

Prevent parent window scrolling when view is focused

Fixes #635
This commit is contained in:
Nick O'Leary 2016-05-18 09:53:04 +01:00
parent b78682f413
commit 7318a7b767

View File

@ -78,7 +78,7 @@ RED.view = (function() {
.attr("pointer-events", "all") .attr("pointer-events", "all")
.style("cursor","crosshair") .style("cursor","crosshair")
.on("mousedown", function() { .on("mousedown", function() {
$(this).focus(); focusView();
}); });
var vis = outer var vis = outer
@ -2148,7 +2148,10 @@ RED.view = (function() {
} }
function focusView() { function focusView() {
var scrollX = window.parent.window.scrollX;
var scrollY = window.parent.window.scrollY;
$("#chart svg").focus(); $("#chart svg").focus();
window.parent.window.scrollTo(scrollX,scrollY);
} }
/** /**