/* 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.';
}
for (var j = 0; j < gs.length; j++) {
if (gs[j] == me) {
if (prevCallbacks[j] && prevCallbacks[j].drawCallback) {
- prevCallbacks[j].drawCallback(me, initial);
+ prevCallbacks[j].drawCallback.apply(this, arguments);
}
continue;
}
}
block = false;
}
- }, false /* no need to redraw */);
+ }, true /* no need to redraw */);
}
}
for (var i = 0; i < gs.length; i++) {
if (me == gs[i]) {
if (prevCallbacks[i] && prevCallbacks[i].highlightCallback) {
- prevCallbacks[i].highlightCallback(event, x, points, row, seriesName);
+ prevCallbacks[i].highlightCallback.apply(this, arguments);
}
continue;
}
for (var i = 0; i < gs.length; i++) {
if (me == gs[i]) {
if (prevCallbacks[i] && prevCallbacks[i].unhighlightCallback) {
- prevCallbacks[i].unhighlightCallback(event);
+ prevCallbacks[i].unhighlightCallback.apply(this, arguments);
}
continue;
}
}
block = false;
}
- });
+ }, true /* no need to redraw */);
}
}
+Dygraph.synchronize = synchronize;
+
})();