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
1 changed files with 4 additions and 1 deletions

View File

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