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

Loading…
Cancel
Save