Commit 4f7b9f53 authored by Valentin Hervieu's avatar Valentin Hervieu

Fixes #106 (rz-slider-on-change fires before value is changed)

parent 84189f14
{ {
"name": "angularjs-slider", "name": "angularjs-slider",
"version": "0.1.25", "version": "0.1.26",
"homepage": "https://github.com/rzajac/angularjs-slider", "homepage": "https://github.com/rzajac/angularjs-slider",
"authors": [ "authors": [
"Rafal Zajac <rzajac@gmail.com>", "Rafal Zajac <rzajac@gmail.com>",
......
This diff is collapsed.
{ {
"name": "jusas-angularjs-slider", "name": "jusas-angularjs-slider",
"version": "0.1.25", "version": "0.1.26",
"description": "AngularJS slider directive with no external dependencies. Mobile friendly!.", "description": "AngularJS slider directive with no external dependencies. Mobile friendly!.",
"main": "rzslider.js", "main": "rzslider.js",
"repository": { "repository": {
......
...@@ -608,7 +608,6 @@ function throttle(func, wait, options) { ...@@ -608,7 +608,6 @@ function throttle(func, wait, options) {
*/ */
updateHandles: function(which, newOffset) updateHandles: function(which, newOffset)
{ {
this.callOnChange();
if(which === 'rzSliderModel') if(which === 'rzSliderModel')
{ {
this.updateLowHandle(newOffset); this.updateLowHandle(newOffset);
...@@ -1135,6 +1134,7 @@ function throttle(func, wait, options) { ...@@ -1135,6 +1134,7 @@ function throttle(func, wait, options) {
this.maxH.addClass('rz-active'); this.maxH.addClass('rz-active');
/* We need to apply here because we are not sure that we will enter the next block */ /* We need to apply here because we are not sure that we will enter the next block */
this.scope.$apply(); this.scope.$apply();
this.callOnChange();
} }
else if(this.tracking === 'rzSliderHigh' && newValue <= this.scope.rzSliderModel) else if(this.tracking === 'rzSliderHigh' && newValue <= this.scope.rzSliderModel)
{ {
...@@ -1145,6 +1145,7 @@ function throttle(func, wait, options) { ...@@ -1145,6 +1145,7 @@ function throttle(func, wait, options) {
this.minH.addClass('rz-active'); this.minH.addClass('rz-active');
/* We need to apply here because we are not sure that we will enter the next block */ /* We need to apply here because we are not sure that we will enter the next block */
this.scope.$apply(); this.scope.$apply();
this.callOnChange();
} }
} }
...@@ -1153,6 +1154,7 @@ function throttle(func, wait, options) { ...@@ -1153,6 +1154,7 @@ function throttle(func, wait, options) {
this.scope[this.tracking] = newValue; this.scope[this.tracking] = newValue;
this.updateHandles(this.tracking, newOffset); this.updateHandles(this.tracking, newOffset);
this.scope.$apply(); this.scope.$apply();
this.callOnChange();
} }
}, },
......
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