diff options
Diffstat (limited to 'www/lib/angular-awesome-slider/src/core/index.js')
| -rw-r--r-- | www/lib/angular-awesome-slider/src/core/index.js | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/www/lib/angular-awesome-slider/src/core/index.js b/www/lib/angular-awesome-slider/src/core/index.js index 75ca7888..069c02df 100644 --- a/www/lib/angular-awesome-slider/src/core/index.js +++ b/www/lib/angular-awesome-slider/src/core/index.js @@ -49,7 +49,7 @@ if (scope.options.calculate && typeof scope.options.calculate === 'function') { scope.from = scope.options.calculate(scope.from); scope.to = scope.options.calculate(scope.to); - } + } var OPTIONS = { from: !scope.options.round ? parseInt(scope.options.from, 10) : parseFloat(scope.options.from), @@ -88,7 +88,7 @@ if (scope.ngDisabled) { disabler(scope.ngDisabled); - } + } initialized = true; }; @@ -118,16 +118,16 @@ } if (scope.slider) { - var firstPtr = scope.slider.getPointers()[0]; - // reset to lowest value - firstPtr.set(scope.from, true); - if (ngModel.$viewValue.split(';')[1]) { - var secondPtr = scope.slider.getPointers()[1]; - // reset to biggest value - firstPtr.set(scope.to, true); - secondPtr.set(ngModel.$viewValue.split(';')[1], true); + var vals = ngModel.$viewValue.split(";"); + scope.slider.getPointers()[0].set(vals[0], true); + if (vals[1]) { + scope.slider.getPointers()[1].set(vals[1], true); + //if moving left to right with two pointers + //we need to "finish" moving the first + if(parseInt(vals[1]) > parseInt(vals[0])){ + scope.slider.getPointers()[0].set(vals[0], true); + } } - firstPtr.set(ngModel.$viewValue.split(';')[0], true); } }; @@ -161,14 +161,14 @@ scope.$watch('ngDisabled', function(value) { disabler(value); - }); + }); scope.limitValue = function(value) { if (scope.options.modelLabels) { if (angular.isFunction(scope.options.modelLabels)) { return scope.options.modelLabels(value); - } - return scope.options.modelLabels[value] !== undefined ? scope.options.modelLabels[value] : value; + } + return scope.options.modelLabels[value] !== undefined ? scope.options.modelLabels[value] : value; } return value; }; |
