From aee17692782df5f90b9c39ac295875810c05d726 Mon Sep 17 00:00:00 2001 From: mjanda Date: Mon, 2 Feb 2015 09:53:27 +0100 Subject: [PATCH] Call previously attached callbacks Conflicts: extras/synchronizer.js --- extras/synchronizer.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/extras/synchronizer.js b/extras/synchronizer.js index 66dc2d8..922da41 100644 --- a/extras/synchronizer.js +++ b/extras/synchronizer.js @@ -126,8 +126,10 @@ function attachZoomHandlers(gs) { var block = false; for (var i = 0; i < gs.length; i++) { var g = gs[i]; + var oldDC = g.getFunctionOption('drawCallback'); g.updateOptions({ drawCallback: function(me, initial) { + if (oldDC) oldDC(me, initial); if (block || initial) return; block = true; var range = me.xAxisRange(); @@ -149,8 +151,11 @@ function attachSelectionHandlers(gs) { var block = false; for (var i = 0; i < gs.length; i++) { var g = gs[i]; + var oldHC = g.getFunctionOption('highlightCallback'); + var oldUHC = g.getFunctionOption('unhighlightCallback'); g.updateOptions({ highlightCallback: function(event, x, points, row, seriesName) { + if (oldHC) oldHC(event, x, points, row, seriesName); if (block) return; block = true; var me = this; @@ -164,6 +169,7 @@ function attachSelectionHandlers(gs) { block = false; }, unhighlightCallback: function(event) { + if (oldUHC) oldUHC(event); if (block) return; block = true; var me = this; -- 2.7.4