Commit f8cfa774 authored by Valentin Hervieu's avatar Valentin Hervieu

perf(onStart): Remove the call.

onStart should be called before any update so it should not be wrapped inside a .
parent dbaddf78
......@@ -248,7 +248,7 @@ $scope.slider = {
**onlyBindHandles** - _Boolean (defaults to false)_: Set to true to only bind events on slider handles.
**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.
**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.
**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.
......
......@@ -795,10 +795,7 @@
*/
callOnStart: function() {
if (this.options.onStart) {
var self = this;
$timeout(function() {
self.options.onStart(self.options.id);
});
this.options.onStart(this.options.id);
}
},
......
This diff is collapsed.
......@@ -799,10 +799,7 @@
*/
callOnStart: function() {
if (this.options.onStart) {
var self = this;
$timeout(function() {
self.options.onStart(self.options.id);
});
this.options.onStart(this.options.id);
}
},
......
......@@ -504,7 +504,6 @@ describe('rzslider - ', function() {
createSlider(sliderConf);
slider.callOnStart();
$timeout.flush();
sliderConf.options.onStart.calledWith('test').should.be.true;
});
......
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