Update timelines zoom slider directive (WIP)

pull/1301/head
Till Breuer 11 years ago
parent e31ccef3ed
commit 888ed525ad
  1. 13
      app/assets/javascripts/angular/directives/timelines/zoom_slider_directive.js

@ -2,18 +2,18 @@ timelinesApp.directive('zoomSlider', function() {
return { return {
restrict: 'A', restrict: 'A',
link: function(scope, element, attributes) { link: function(scope, element, attributes) {
zooms = jQuery('select[name="zooms"]'); currentScaleIndex = Timeline.ZOOM_SCALES.indexOf(scope.currentScale);
element.slider({ scope.slider = element.slider({
min: 1, min: 1,
max: Timeline.ZOOM_SCALES.length, max: Timeline.ZOOM_SCALES.length,
range: 'min', range: 'min',
value: zooms[0].selectedIndex + 1, value: currentScaleIndex + 1,
slide: function(event, ui) { slide: function(event, ui) {
zooms[0].selectedIndex = ui.value - 1; currentScaleIndex = ui.value - 1;
}, },
change: function(event, ui) { change: function(event, ui) {
zooms[0].selectedIndex = ui.value - 1; currentScaleIndex = ui.value - 1;
timeline.zoom(ui.value - 1); scope.timeline.zoom(ui.value - 1);
} }
}).css({ }).css({
// top right bottom left // top right bottom left
@ -22,3 +22,4 @@ timelinesApp.directive('zoomSlider', function() {
} }
}; };
}); });

Loading…
Cancel
Save