From aac4c9a872227566a3ae3fc6316fd160a4f42205 Mon Sep 17 00:00:00 2001 From: Colin McLeod Date: Tue, 1 Sep 2015 18:05:35 -0700 Subject: [PATCH] Fix to slider events --- app/js/directives/directive-slider.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/js/directives/directive-slider.js b/app/js/directives/directive-slider.js index f6e6951c..357da877 100644 --- a/app/js/directives/directive-slider.js +++ b/app/js/directives/directive-slider.js @@ -51,6 +51,7 @@ angular.module('app').directive('slider', ['$window', function($window) { function brushed() { val = x.invert(d3.mouse(this)[0]); brush.extent([val, val]); + scope.change({ val: val }); drawBrush(); } @@ -58,7 +59,6 @@ angular.module('app').directive('slider', ['$window', function($window) { if (unit) { lbl.text(fmt(val) + ' ' + unit + ' ' + pct(val / scope.max)); } - scope.change({ val: val }); handle.attr('cx', x(val)); filled.attr('d', 'M0,0V0H' + x(val) + 'V0'); } @@ -77,7 +77,7 @@ angular.module('app').directive('slider', ['$window', function($window) { scope.$on('reset', function() { val = def; - render(); + drawBrush(); }); scope.$on('$destroy', function() {