Commit 7ae70d2a authored by Rafal Zajac's avatar Rafal Zajac

Merge branch 'kvindasAB-master'

parents 80e2c59c ec8b49ab
......@@ -215,10 +215,10 @@ function throttle(func, wait, options) {
});
// Recalculate slider view dimensions
this.scope.$on('reCalcViewDimensions', angular.bind(this, this.calcViewDimensions));
this.scope.$on('reCalcViewDimensions', angular.bind(this, this.resetSlider));
// Recalculate stuff if view port dimensions have changed
angular.element(window).on('resize', angular.bind(this, this.calcViewDimensions));
angular.element(window).on('resize', angular.bind(this, this.resetSlider));
this.initRun = true;
......@@ -256,8 +256,39 @@ function throttle(func, wait, options) {
if(newValue === oldValue) return;
thrHigh();
});
this.scope.$watch('rzSliderFloor', function(newValue, oldValue){
if(newValue === oldValue) return;
self.resetSlider();
});
this.scope.$watch('rzSliderCeil', function(newValue, oldValue){
if(newValue === oldValue) return;
self.resetSlider();
});
this.scope.$watch('rzSliderForceRender', function(newValue, oldValue){
self.resetLabelsWidth();
thrLow();
thrHigh();
self.resetSlider();
});
},
resetSlider: function() {
this.setMinAndMax();
this.calcViewDimensions();
this.updateCeilLab();
this.updateFloorLab();
},
resetLabelsWidth: function() {
this.minLab.rzsv = undefined;
this.maxLab.rzsv = undefined;
},
/**
* Initialize slider handles positions and labels
*
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment