projects
/
dygraphs.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
375adb8
)
Fix issue 322: calling destroy() results in an error in IE8
author
Dan Vanderkam
<danvk@google.com>
Mon, 13 Aug 2012 21:53:23 +0000
(17:53 -0400)
committer
Dan Vanderkam
<danvk@google.com>
Mon, 13 Aug 2012 21:53:23 +0000
(17:53 -0400)
dygraph-utils.js
patch
|
blob
|
blame
|
history
diff --git
a/dygraph-utils.js
b/dygraph-utils.js
index
e942f0c
..
dd8c620
100644
(file)
--- a/
dygraph-utils.js
+++ b/
dygraph-utils.js
@@
-177,7
+177,12
@@
Dygraph.removeEvent = function addEvent(elem, type, fn) {
if (elem.removeEventListener) {
elem.removeEventListener(type, fn, false);
} else {
- elem.detachEvent('on'+type, elem[type+fn]);
+ try {
+ elem.detachEvent('on'+type, elem[type+fn]);
+ } catch(e) {
+ // We only detach event listeners on a "best effort" basis in IE. See:
+ // http://stackoverflow.com/questions/2553632/detachevent-not-working-with-named-inline-functions
+ }
elem[type+fn] = null;
}
};