Merge pull request #197 from kberg/dounzoom
authorDan Vanderkam <danvdk@gmail.com>
Thu, 10 Jan 2013 21:59:42 +0000 (13:59 -0800)
committerDan Vanderkam <danvdk@gmail.com>
Thu, 10 Jan 2013 21:59:42 +0000 (13:59 -0800)
Move doUnzoom_ to the public API.

dygraph-interaction-model.js
dygraph-range-selector.js
dygraph.js

index b5e9ee3..9654f28 100644 (file)
@@ -574,9 +574,7 @@ Dygraph.Interaction.defaultModel = {
     if (event.altKey || event.shiftKey) {
       return;
     }
-    // TODO(konigsberg): replace g.doUnzoom()_ with something that is
-    // friendlier to public use.
-    g.doUnzoom_();
+    g.resetZoom();
   }
 };
 
index b777470..0a1ae13 100644 (file)
@@ -278,7 +278,7 @@ DygraphRangeSelector.prototype.initInteraction_ = function() {
       var zoomHandleStatus = self.getZoomHandleStatus_();
       self.isChangingRange_ = true;
       if (!zoomHandleStatus.isZoomed) {
-        self.dygraph_.doUnzoom_();
+        self.dygraph_.resetZoom();
       } else {
         var xDataWindow = toXDataWindow(zoomHandleStatus);
         self.dygraph_.doZoomXDates_(xDataWindow[0], xDataWindow[1]);
index 4c8c65d..c867c66 100644 (file)
@@ -1462,10 +1462,8 @@ Dygraph.prototype.doZoomY_ = function(lowY, highY) {
 /**
  * Reset the zoom to the original view coordinates. This is the same as
  * double-clicking on the graph.
- *
- * @private
  */
-Dygraph.prototype.doUnzoom_ = function() {
+Dygraph.prototype.resetZoom = function() {
   var dirty = false, dirtyX = false, dirtyY = false;
   if (this.dateWindow_ !== null) {
     dirty = true;