X-Git-Url: https://adrianiainlam.tk/git/?a=blobdiff_plain;f=src%2Fextras%2Fsynchronizer.js;fp=src%2Fextras%2Fsynchronizer.js;h=bf5b6f34b1177663da39d4ef4c71d33e3496b1b4;hb=ce31caf22475e3e1fd6d9fea192d61ff4fcd7fac;hp=dd4329cf25b0942b5f61b82e81c4ece6087d56c4;hpb=a4c3ece0a11e4e5c4f1f51a8bc8b7878d34ee052;p=dygraphs.git diff --git a/src/extras/synchronizer.js b/src/extras/synchronizer.js index dd4329c..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.'; } @@ -217,4 +224,6 @@ function attachSelectionHandlers(gs, prevCallbacks) { } } +Dygraph.synchronize = synchronize; + })();