projects
/
dygraphs.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
9356951
)
resize handler only added once per graph.
author
Robert Konigsberg
<konigsberg@google.com>
Fri, 25 Jan 2013 18:40:20 +0000
(13:40 -0500)
committer
Robert Konigsberg
<konigsberg@google.com>
Fri, 25 Jan 2013 18:40:20 +0000
(13:40 -0500)
dygraph.js
patch
|
blob
|
blame
|
history
diff --git
a/dygraph.js
b/dygraph.js
index
ecbbca7
..
3803d9a
100644
(file)
--- a/
dygraph.js
+++ b/
dygraph.js
@@
-966,13
+966,15
@@
Dygraph.prototype.createInterface_ = function() {
};
this.addEvent(this.mouseEventElement_, 'mouseout', this.mouseOutHandler);
};
this.addEvent(this.mouseEventElement_, 'mouseout', this.mouseOutHandler);
- this.resizeHandler = function(e) {
- dygraph.resize();
- };
+ if (!this.resizeHandler_) {
+ this.resizeHandler_ = function(e) {
+ dygraph.resize();
+ };
- // Update when the window is resized.
- // TODO(danvk): drop frames depending on complexity of the chart.
- this.addEvent(window, 'resize', this.resizeHandler);
+ // Update when the window is resized.
+ // TODO(danvk): drop frames depending on complexity of the chart.
+ this.addEvent(window, 'resize', this.resizeHandler_);
+ }
};
/**
};
/**
@@
-1008,8
+1010,8
@@
Dygraph.prototype.destroy = function() {
}
};
// remove event handlers
}
};
// remove event handlers
- Dygraph.removeEvent(window,'resize',this.resizeHandler);
- this.resizeHandler = null;
+ Dygraph.removeEvent(window,'resize',this.resizeHandler
_
);
+ this.resizeHandler
_
= null;
// These may not all be necessary, but it can't hurt...
nullOut(this.layout_);
nullOut(this.plotter_);
// These may not all be necessary, but it can't hurt...
nullOut(this.layout_);
nullOut(this.plotter_);