projects
/
dygraphs.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
194075f
)
Adding an robustness test before using the registered events member.
author
manufitoussi
<manu.fitoussi@gmail.com>
Fri, 25 Jan 2013 13:25:46 +0000
(14:25 +0100)
committer
manufitoussi
<manu.fitoussi@gmail.com>
Fri, 25 Jan 2013 13:25:46 +0000
(14:25 +0100)
dygraph.js
patch
|
blob
|
blame
|
history
diff --git
a/dygraph.js
b/dygraph.js
index
ae089d0
..
fc50740
100644
(file)
--- a/
dygraph.js
+++ b/
dygraph.js
@@
-994,10
+994,13
@@
Dygraph.prototype.destroy = function() {
}
};
- for (var idx = 0; idx < this.registeredEvents_.length; idx++) {
- var reg = this.registeredEvents_[idx];
- Dygraph.removeEvent(reg.elem, reg.type, reg.fn);
+ if (this.registeredEvents_) {
+ for (var idx = 0; idx < this.registeredEvents_.length; idx++) {
+ var reg = this.registeredEvents_[idx];
+ Dygraph.removeEvent(reg.elem, reg.type, reg.fn);
+ }
}
+
this.registeredEvents_ = [];
// remove mouse event handlers (This may not be necessary anymore)