X-Git-Url: https://adrianiainlam.tk/git/?a=blobdiff_plain;f=tests%2Finteraction.js;h=6ce65a8553e9e5999c5c13295852b502acd613f0;hb=f0e472002843b5e61aa9467f97f755280c91a46b;hp=08efc6fe98b2b914407cd7005023a21b9e7c5bd3;hpb=e26b71566419e1c051f3fbd1f4f8f64b063a04c9;p=dygraphs.git diff --git a/tests/interaction.js b/tests/interaction.js index 08efc6f..6ce65a8 100644 --- a/tests/interaction.js +++ b/tests/interaction.js @@ -83,7 +83,8 @@ var lastClickedGraph = null; function clickV3(event, g, context) { lastClickedGraph = g; - Dygraph.cancelEvent(event); + event.preventDefault(); + event.stopPropagation(); } function scrollV3(event, g, context) { @@ -105,7 +106,8 @@ function scrollV3(event, g, context) { var yPct = percentages[1]; zoom(g, percentage, xPct, yPct); - Dygraph.cancelEvent(event); + event.preventDefault(); + event.stopPropagation(); } // Adjusts [x, y] toward each other by zoomInPercentage% @@ -149,8 +151,9 @@ function moveV4(event, g, context) { var RANGE = 7; if (v4Active) { - var canvasx = Dygraph.pageX(event) - Dygraph.findPosX(g.graphDiv); - var canvasy = Dygraph.pageY(event) - Dygraph.findPosY(g.graphDiv); + var graphPos = Dygraph.findPos(g.graphDiv); + var canvasx = Dygraph.pageX(event) - graphPos.x; + var canvasy = Dygraph.pageY(event) - graphPos.y; var rows = g.numRows(); // Row layout: