Skip to content

Commit 80e2c59

Browse files
committed
Add reCalcViewDimensions event
1 parent 789475f commit 80e2c59

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

rzslider.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ function throttle(func, wait, options) {
202202
this.initElemHandles();
203203
this.calcViewDimensions();
204204

205-
this.setMinAndMax();
205+
this.setMinAndMax();
206206
this.precision = this.scope.rzSliderPrecision === undefined ? 0 : +this.scope.rzSliderPrecision;
207207
this.step = this.scope.rzSliderStep === undefined ? 1 : +this.scope.rzSliderStep;
208208

@@ -214,6 +214,9 @@ function throttle(func, wait, options) {
214214
self.bindEvents();
215215
});
216216

217+
// Recalculate slider view dimensions
218+
this.scope.$on('reCalcViewDimensions', angular.bind(this, this.calcViewDimensions));
219+
217220
// Recalculate stuff if view port dimensions have changed
218221
angular.element(window).on('resize', angular.bind(this, this.calcViewDimensions));
219222

@@ -726,7 +729,7 @@ function throttle(func, wait, options) {
726729

727730
if(this.tracking !== '') { return }
728731

729-
// We have to do this in case the HTML where the sliders are on
732+
// We have to do this in case the HTML where the sliders are on
730733
// have been animated into view.
731734
this.calcViewDimensions();
732735
this.tracking = ref;

0 commit comments

Comments
 (0)