From: mjanda Date: Mon, 2 Feb 2015 08:53:27 +0000 (+0100) Subject: Call previously attached callbacks X-Git-Tag: v1.1.1~15 X-Git-Url: https://adrianiainlam.tk/git/?a=commitdiff_plain;h=aee17692782df5f90b9c39ac295875810c05d726;p=dygraphs.git Call previously attached callbacks Conflicts: extras/synchronizer.js --- 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;