Skip to content

Configurable update interval #153

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Oct 15, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,10 @@ $scope.priceSlider = {

> Disable the slider (apply a special style and unbind events)

**rz-slider-interval**

> 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.

```javascript
// In your controller

Expand Down
13 changes: 11 additions & 2 deletions dist/rzslider.js
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,14 @@ function throttle(func, wait, options) {
*/
this.disabled = this.scope.rzSliderDisabled;

/**
* The interval at which the slider updates when the model/high values
* are altered from outside the slider
*
* @type {number}
*/
this.interval = this.scope.rzSliderInterval !== null ? this.scope.rzSliderInterval : 350;

/**
* The delta between min and max value
*
Expand Down Expand Up @@ -330,7 +338,7 @@ function throttle(func, wait, options) {
self.updateCmbLabel();
}

}, 350, { leading: false });
}, self.interval);

thrHigh = throttle(function()
{
Expand All @@ -339,7 +347,7 @@ function throttle(func, wait, options) {
self.updateSelectionBar();
self.updateTicksScale();
self.updateCmbLabel();
}, 350, { leading: false });
}, self.interval);

this.scope.$on('rzSliderForceRender', function()
{
Expand Down Expand Up @@ -1414,6 +1422,7 @@ function throttle(func, wait, options) {
rzSliderShowTicks: '=?',
rzSliderShowTicksValue: '=?',
rzSliderDisabled: '=?',
rzSliderInterval: '=?',
},

/**
Expand Down
2 changes: 1 addition & 1 deletion dist/rzslider.min.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading