X-Git-Url: https://adrianiainlam.tk/git/?a=blobdiff_plain;f=src%2Fextras%2Fsynchronizer.js;h=bf5b6f34b1177663da39d4ef4c71d33e3496b1b4;hb=ac928d203b05de4a8d43ad89667347865e98bb7c;hp=78efbcba29508ba0bfcc7d956f735f7748f2eff0;hpb=48651beba22d456c1226b62392072684298aca12;p=dygraphs.git diff --git a/src/extras/synchronizer.js b/src/extras/synchronizer.js index 78efbcb..bf5b6f3 100644 --- a/src/extras/synchronizer.js +++ b/src/extras/synchronizer.js @@ -35,7 +35,14 @@ /* global Dygraph:false */ 'use strict'; -Dygraph.synchronize = function(/* dygraphs..., opts */) { +var Dygraph; +if (window.Dygraph) { + Dygraph = window.Dygraph; +} else if (typeof(module) !== 'undefined') { + Dygraph = require('../dygraph'); +} + +var synchronize = function(/* dygraphs..., opts */) { if (arguments.length === 0) { throw 'Invalid invocation of Dygraph.synchronize(). Need >= 1 argument.'; } @@ -170,7 +177,7 @@ function attachZoomHandlers(gs, syncOpts, prevCallbacks) { } block = false; } - }, false /* no need to redraw */); + }, true /* no need to redraw */); } } @@ -213,8 +220,10 @@ function attachSelectionHandlers(gs, prevCallbacks) { } block = false; } - }); + }, true /* no need to redraw */); } } +Dygraph.synchronize = synchronize; + })();