Skip to content

Commit fef8c8b

Browse files
committed
Merge pull request #153 from elifitch/configurable-interval
Configurable update interval
2 parents bbe0459 + 801bea7 commit fef8c8b

File tree

5 files changed

+29
-7
lines changed

5 files changed

+29
-7
lines changed

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,10 @@ $scope.priceSlider = {
155155

156156
> Disable the slider (apply a special style and unbind events)
157157
158+
**rz-slider-interval**
159+
160+
> The interval (in ms) at which the slider DOM element updates when rz-slider-model or rz-slider-high change from outside the slider. Defaults to 350.
161+
158162
```javascript
159163
// In your controller
160164

dist/rzslider.js

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -232,6 +232,14 @@ function throttle(func, wait, options) {
232232
*/
233233
this.disabled = this.scope.rzSliderDisabled;
234234

235+
/**
236+
* The interval at which the slider updates when the model/high values
237+
* are altered from outside the slider
238+
*
239+
* @type {number}
240+
*/
241+
this.interval = this.scope.rzSliderInterval !== null ? this.scope.rzSliderInterval : 350;
242+
235243
/**
236244
* The delta between min and max value
237245
*
@@ -330,7 +338,7 @@ function throttle(func, wait, options) {
330338
self.updateCmbLabel();
331339
}
332340

333-
}, 350, { leading: false });
341+
}, self.interval);
334342

335343
thrHigh = throttle(function()
336344
{
@@ -339,7 +347,7 @@ function throttle(func, wait, options) {
339347
self.updateSelectionBar();
340348
self.updateTicksScale();
341349
self.updateCmbLabel();
342-
}, 350, { leading: false });
350+
}, self.interval);
343351

344352
this.scope.$on('rzSliderForceRender', function()
345353
{
@@ -1414,6 +1422,7 @@ function throttle(func, wait, options) {
14141422
rzSliderShowTicks: '=?',
14151423
rzSliderShowTicksValue: '=?',
14161424
rzSliderDisabled: '=?',
1425+
rzSliderInterval: '=?',
14171426
},
14181427

14191428
/**

dist/rzslider.min.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)