Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
RadMie committed Jun 2, 2016
1 parent caf858b commit b22d6e8
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 7 deletions.
3 changes: 1 addition & 2 deletions dist/ng-knob.js
Expand Up @@ -270,7 +270,7 @@
}
};
Knob.prototype.setValue = function(newValue) {
if (!this.inDrag && newValue >= this.options.min && newValue <= this.options.max) {
if (!this.inDrag && this.value >= this.options.min && this.value <= this.options.max) {
var radians = this.valueToRadians(newValue, this.options.max, this.options.endAngle, this.options.startAngle, this.options.min);
this.value = Math.round(~~((newValue < 0 ? -.5 : .5) + newValue / this.options.step) * this.options.step * 100) / 100;
if (this.options.step < 1) {
Expand Down Expand Up @@ -357,7 +357,6 @@
scope.$watch("value", function(newValue, oldValue) {
if ((newValue !== null || typeof newValue !== "undefined") && typeof oldValue !== "undefined" && newValue !== oldValue) {
knob.setValue(newValue);
drawKnob();
}
});
if (scope.options.dynamicOptions) {
Expand Down

0 comments on commit b22d6e8

Please sign in to comment.