Skip to content

Commit

Permalink
watch for changes to both total and current
Browse files Browse the repository at this point in the history
Fixes #12
Thanks @bropp to bringing it to my attention
  • Loading branch information
stakach committed Sep 19, 2014
1 parent 34b416b commit f60c513
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions orbicular.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,12 @@
setWidth = function () {
var width = element.prop('offsetWidth');
element.css('font-size', width - (width % 2) + 'px');
},

update = function () {
updateProgress(circles, fix,
scope.current / scope.total * 180.0
);
};


Expand Down Expand Up @@ -119,10 +125,8 @@
}

// we watch for changes to the progress indicator of the parent scope
scope.$watch('current', function (newValue) {
newValue = newValue / scope.total * 180.0;
updateProgress(circles, fix, newValue);
});
scope.$watch('current', update);
scope.$watch('total', update);
}
};
}]);
Expand Down

0 comments on commit f60c513

Please sign in to comment.