Skip to content

Commit ec8b49a

Browse files
author
kvindasAB
committed
Improvements over re-render mechanisms.
Fixes issues presented on hidden tab rendering.
1 parent 07ec816 commit ec8b49a

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

rzslider.js

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -215,10 +215,10 @@ function throttle(func, wait, options) {
215215
});
216216

217217
// Recalculate slider view dimensions
218-
this.scope.$on('reCalcViewDimensions', angular.bind(this, this.calcViewDimensions));
218+
this.scope.$on('reCalcViewDimensions', angular.bind(this, this.resetSlider));
219219

220220
// Recalculate stuff if view port dimensions have changed
221-
angular.element(window).on('resize', angular.bind(this, this.calcViewDimensions));
221+
angular.element(window).on('resize', angular.bind(this, this.resetSlider));
222222

223223
this.initRun = true;
224224

@@ -268,6 +268,13 @@ function throttle(func, wait, options) {
268268
self.resetSlider();
269269
});
270270

271+
this.scope.$watch('rzSliderForceRender', function(newValue, oldValue){
272+
self.resetLabelsWidth();
273+
thrLow();
274+
thrHigh();
275+
self.resetSlider();
276+
});
277+
271278
},
272279

273280
resetSlider: function() {
@@ -277,6 +284,11 @@ function throttle(func, wait, options) {
277284
this.updateFloorLab();
278285
},
279286

287+
resetLabelsWidth: function() {
288+
this.minLab.rzsv = undefined;
289+
this.maxLab.rzsv = undefined;
290+
},
291+
280292
/**
281293
* Initialize slider handles positions and labels
282294
*

0 commit comments

Comments
 (0)