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