Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit f8cfa77

Browse files
author
Valentin Hervieu
committed
perf(onStart): Remove the call.
onStart should be called before any update so it should not be wrapped inside a .
1 parent dbaddf7 commit f8cfa77

File tree

5 files changed

+4
-11
lines changed

5 files changed

+4
-11
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@ $scope.slider = {
248248

249249
**onlyBindHandles** - _Boolean (defaults to false)_: Set to true to only bind events on slider handles.
250250

251-
**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.
251+
**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. This callback is called before any update on the model.
252252

253253
**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.
254254

dist/rzslider.js

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -795,10 +795,7 @@
795795
*/
796796
callOnStart: function() {
797797
if (this.options.onStart) {
798-
var self = this;
799-
$timeout(function() {
800-
self.options.onStart(self.options.id);
801-
});
798+
this.options.onStart(this.options.id);
802799
}
803800
},
804801

0 commit comments

Comments
 (0)