projects
/
dygraphs.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Rewrite tests to use ES6 modules.
[dygraphs.git]
/
src
/
extras
/
synchronizer.js
diff --git
a/src/extras/synchronizer.js
b/src/extras/synchronizer.js
index
dd4329c
..
bf5b6f3
100644
(file)
--- a/
src/extras/synchronizer.js
+++ b/
src/extras/synchronizer.js
@@
-35,7
+35,14
@@
/* global Dygraph:false */
'use strict';
/* 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.';
}
if (arguments.length === 0) {
throw 'Invalid invocation of Dygraph.synchronize(). Need >= 1 argument.';
}
@@
-217,4
+224,6
@@
function attachSelectionHandlers(gs, prevCallbacks) {
}
}
}
}
+Dygraph.synchronize = synchronize;
+
})();
})();