mirror of
https://github.com/EDCD/coriolis.git
synced 2025-12-11 08:43:02 +00:00
Fix to slider events
This commit is contained in:
@@ -51,6 +51,7 @@ angular.module('app').directive('slider', ['$window', function($window) {
|
|||||||
function brushed() {
|
function brushed() {
|
||||||
val = x.invert(d3.mouse(this)[0]);
|
val = x.invert(d3.mouse(this)[0]);
|
||||||
brush.extent([val, val]);
|
brush.extent([val, val]);
|
||||||
|
scope.change({ val: val });
|
||||||
drawBrush();
|
drawBrush();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -58,7 +59,6 @@ angular.module('app').directive('slider', ['$window', function($window) {
|
|||||||
if (unit) {
|
if (unit) {
|
||||||
lbl.text(fmt(val) + ' ' + unit + ' ' + pct(val / scope.max));
|
lbl.text(fmt(val) + ' ' + unit + ' ' + pct(val / scope.max));
|
||||||
}
|
}
|
||||||
scope.change({ val: val });
|
|
||||||
handle.attr('cx', x(val));
|
handle.attr('cx', x(val));
|
||||||
filled.attr('d', 'M0,0V0H' + x(val) + 'V0');
|
filled.attr('d', 'M0,0V0H' + x(val) + 'V0');
|
||||||
}
|
}
|
||||||
@@ -77,7 +77,7 @@ angular.module('app').directive('slider', ['$window', function($window) {
|
|||||||
|
|
||||||
scope.$on('reset', function() {
|
scope.$on('reset', function() {
|
||||||
val = def;
|
val = def;
|
||||||
render();
|
drawBrush();
|
||||||
});
|
});
|
||||||
|
|
||||||
scope.$on('$destroy', function() {
|
scope.$on('$destroy', function() {
|
||||||
|
|||||||
Reference in New Issue
Block a user