Skip to content

Commit

Permalink
Moved spinner updating back to 'stop' event to prevent object from re…
Browse files Browse the repository at this point in the history
…porting different DTSTART value than what appears on the screen.
  • Loading branch information
ansiblegalaxy committed Apr 5, 2014
1 parent b1ffbc8 commit 618c50f
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 12 deletions.
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "angular-scheduler",
"version": "0.0.13",
"version": "0.0.14",
"authors": [
"Chris Houseknecht <chouse@ansible.com>"
],
Expand Down
15 changes: 6 additions & 9 deletions lib/angular-scheduler.js
Original file line number Diff line number Diff line change
Expand Up @@ -1042,24 +1042,21 @@ angular.module('AngularScheduler', ['underscore'])
$(element).spinner({
min: min,
max: max,
change: function() {
stop: function() {
//update the model immediately
setTimeout(function() {
scope.$apply(function() {
if (zeroPad) {
scope[attr.ngModel] = $filter('schZeroPad')($(element).spinner('value'),zeroPad);
$(element).val(scope[attr.ngModel]);
if (attr.ngChange) {
scope.$eval(attr.ngChange);
}
}
else {
scope[attr.ngModel] = $(element).spinner('value');
if (attr.ngChange) {
scope.$eval(attr.ngChange);
}
}
if (attr.ngChange) {
scope.$eval(attr.ngChange);
}
});
},100);
}, 100);
},
spin: function() {
scope[form].$setDirty();
Expand Down
Loading

0 comments on commit 618c50f

Please sign in to comment.