Skip to content

Commit 7d76152

Browse files
author
Valentin Hervieu
committed
Improvement - pass the options.id to the onStart, onChange and onEnd callbacks. Closes #175.
1 parent fb02c4c commit 7d76152

File tree

4 files changed

+10
-10
lines changed

4 files changed

+10
-10
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -193,11 +193,11 @@ $scope.slider = {
193193

194194
**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.
195195

196-
**onStart** - _Function()_: Function to be called when a slider update is started.
196+
**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.
197197

198-
**onChange** - _Function()_: Function to be called when rz-slider-model or rz-slider-high change.
198+
**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.
199199

200-
**onEnd** - _Function()_: Function to be called when a slider update is ended.
200+
**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.
201201

202202
## Change default options
203203
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:

dist/rzslider.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -696,7 +696,7 @@
696696
if (this.options.onStart) {
697697
var self = this;
698698
$timeout(function() {
699-
self.options.onStart();
699+
self.options.onStart(self.options.id);
700700
});
701701
}
702702
},
@@ -710,7 +710,7 @@
710710
if (this.options.onChange) {
711711
var self = this;
712712
$timeout(function() {
713-
self.options.onChange();
713+
self.options.onChange(self.options.id);
714714
});
715715
}
716716
},
@@ -724,7 +724,7 @@
724724
if (this.options.onEnd) {
725725
var self = this;
726726
$timeout(function() {
727-
self.options.onEnd();
727+
self.options.onEnd(self.options.id);
728728
});
729729
}
730730
},

dist/rzslider.min.js

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

src/rzslider.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -696,7 +696,7 @@
696696
if (this.options.onStart) {
697697
var self = this;
698698
$timeout(function() {
699-
self.options.onStart();
699+
self.options.onStart(self.options.id);
700700
});
701701
}
702702
},
@@ -710,7 +710,7 @@
710710
if (this.options.onChange) {
711711
var self = this;
712712
$timeout(function() {
713-
self.options.onChange();
713+
self.options.onChange(self.options.id);
714714
});
715715
}
716716
},
@@ -724,7 +724,7 @@
724724
if (this.options.onEnd) {
725725
var self = this;
726726
$timeout(function() {
727-
self.options.onEnd();
727+
self.options.onEnd(self.options.id);
728728
});
729729
}
730730
},

0 commit comments

Comments
 (0)