projects
/
dygraphs.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
two charts on demo page
[dygraphs.git]
/
tests
/
interaction.js
diff --git
a/tests/interaction.js
b/tests/interaction.js
index
1449e71
..
ced5aef
100644
(file)
--- a/
tests/interaction.js
+++ b/
tests/interaction.js
@@
-1,3
+1,6
@@
+// Code for a variety of interaction models. Used in interaction.html, but split out from
+// that file so they can be tested in isolation.
+//
function downV3(event, g, context) {
context.initializeMouseDown(event, g, context);
if (event.altKey || event.shiftKey) {
function downV3(event, g, context) {
context.initializeMouseDown(event, g, context);
if (event.altKey || event.shiftKey) {
@@
-70,7
+73,17
@@
function dblClickV3(event, g, context) {
}
}
}
}
+var lastClickedGraph = null;
+
+function clickV3(event, g, context) {
+ lastClickedGraph = g;
+ Dygraph.cancelEvent(event);
+}
+
function scrollV3(event, g, context) {
function scrollV3(event, g, context) {
+ if (lastClickedGraph != g) {
+ return;
+ }
var normal = event.detail ? event.detail * -1 : event.wheelDelta / 40;
// For me the normalized value shows 0.075 for one click. If I took
// that verbatim, it would be a 7.5%.
var normal = event.detail ? event.detail * -1 : event.wheelDelta / 40;
// For me the normalized value shows 0.075 for one click. If I took
// that verbatim, it would be a 7.5%.