Commit 7d761529 authored by Valentin Hervieu's avatar Valentin Hervieu

Improvement - pass the options.id to the onStart, onChange and onEnd callbacks. Closes #175.

parent fb02c4ca
...@@ -193,11 +193,11 @@ $scope.slider = { ...@@ -193,11 +193,11 @@ $scope.slider = {
**scale** - _Number (defaults to 1)_: If you display the slider in an element that uses `transform: scale(0.5)`, set the `scale` value to 2 so that the slider is rendered properly and the events are handled correctly. **scale** - _Number (defaults to 1)_: If you display the slider in an element that uses `transform: scale(0.5)`, set the `scale` value to 2 so that the slider is rendered properly and the events are handled correctly.
**onStart** - _Function()_: Function to be called when a slider update is started. **onStart** - _Function(sliderId)_: Function to be called when a slider update is started. If an id was set in the options, then it's passed to this callback.
**onChange** - _Function()_: Function to be called when rz-slider-model or rz-slider-high change. **onChange** - _Function(sliderId)_: Function to be called when rz-slider-model or rz-slider-high change. If an id was set in the options, then it's passed to this callback.
**onEnd** - _Function()_: Function to be called when a slider update is ended. **onEnd** - _Function(sliderId)_: Function to be called when a slider update is ended. If an id was set in the options, then it's passed to this callback.
## Change default options ## Change default options
If you want the change the default options for all the sliders displayed in your application, you can set them using the `RzSliderOptions.options()` method: If you want the change the default options for all the sliders displayed in your application, you can set them using the `RzSliderOptions.options()` method:
......
...@@ -696,7 +696,7 @@ ...@@ -696,7 +696,7 @@
if (this.options.onStart) { if (this.options.onStart) {
var self = this; var self = this;
$timeout(function() { $timeout(function() {
self.options.onStart(); self.options.onStart(self.options.id);
}); });
} }
}, },
...@@ -710,7 +710,7 @@ ...@@ -710,7 +710,7 @@
if (this.options.onChange) { if (this.options.onChange) {
var self = this; var self = this;
$timeout(function() { $timeout(function() {
self.options.onChange(); self.options.onChange(self.options.id);
}); });
} }
}, },
...@@ -724,7 +724,7 @@ ...@@ -724,7 +724,7 @@
if (this.options.onEnd) { if (this.options.onEnd) {
var self = this; var self = this;
$timeout(function() { $timeout(function() {
self.options.onEnd(); self.options.onEnd(self.options.id);
}); });
} }
}, },
......
This diff is collapsed.
...@@ -696,7 +696,7 @@ ...@@ -696,7 +696,7 @@
if (this.options.onStart) { if (this.options.onStart) {
var self = this; var self = this;
$timeout(function() { $timeout(function() {
self.options.onStart(); self.options.onStart(self.options.id);
}); });
} }
}, },
...@@ -710,7 +710,7 @@ ...@@ -710,7 +710,7 @@
if (this.options.onChange) { if (this.options.onChange) {
var self = this; var self = this;
$timeout(function() { $timeout(function() {
self.options.onChange(); self.options.onChange(self.options.id);
}); });
} }
}, },
...@@ -724,7 +724,7 @@ ...@@ -724,7 +724,7 @@
if (this.options.onEnd) { if (this.options.onEnd) {
var self = this; var self = this;
$timeout(function() { $timeout(function() {
self.options.onEnd(); self.options.onEnd(self.options.id);
}); });
} }
}, },
......
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