projects
/
dygraphs.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
b94ba4b
)
Add cleanup function to the animation selection so that clearing a selection always...
author
Myles Bostwick
<github@zithora.com>
Thu, 22 Jan 2015 21:38:34 +0000
(14:38 -0700)
committer
Myles Bostwick
<github@zithora.com>
Thu, 22 Jan 2015 21:38:34 +0000
(14:38 -0700)
dygraph.js
patch
|
blob
|
blame
|
history
diff --git
a/dygraph.js
b/dygraph.js
index
5f6e1e1
..
4502bd4
100644
(file)
--- a/
dygraph.js
+++ b/
dygraph.js
@@
-2019,6
+2019,14
@@
Dygraph.prototype.animateSelection_ = function(direction) {
var thisId = ++this.animateId;
var that = this;
var thisId = ++this.animateId;
var that = this;
+ var cleanupIfClearing = function() {
+ // if we haven't reached fadeLevel 0 in the max frame time,
+ // ensure that the clear happens and just go to 0
+ if (that.fadeLevel !== 0 && direction < 0) {
+ that.fadeLevel = 0;
+ that.clearSelection();
+ }
+ };
Dygraph.repeatAndCleanup(
function(n) {
// ignore simultaneous animations
Dygraph.repeatAndCleanup(
function(n) {
// ignore simultaneous animations
@@
-2031,7
+2039,7
@@
Dygraph.prototype.animateSelection_ = function(direction) {
that.updateSelection_(that.fadeLevel / totalSteps);
}
},
that.updateSelection_(that.fadeLevel / totalSteps);
}
},
- steps, millis,
function() {}
);
+ steps, millis,
cleanupIfClearing
);
};
/**
};
/**