Skip to content
Browse files

Moved forceint to render, so it is always called, not just when the m…

…ouse moves
  • Loading branch information...
1 parent 85fe9cb commit d3e547568c89c22839032ade144a14caffb2562a @leegee committed Oct 27, 2012
Showing with 4 additions and 4 deletions.
  1. +4 −4 Source/Knob.js
View
8 Source/Knob.js
@@ -43,7 +43,7 @@ var Knob = new Class({
scale: 1, /* Multiplier applied to number of px moved, to acheive change in .value */
keychangeby: 1, /* When arrow keys control knob, incrase knob value by this */
keychangebywithshift: 10, /* As keyUnit but for when shift key is also pressed */
- forceInt: false, /* Force all values to be integers */
+ forceint: false, /* Force all values to be integers */
monitor: null, /* May be a string or DOM element to monitor: changes in this elements *value* attribute will change the control's *value* attribute, and cause the control to be re-rendered. */
monitorMs: 1000/4, /* Frequency of checking for monitor.value changes */
@@ -257,9 +257,6 @@ var Knob = new Class({
self.movement = (Math.abs(self.x) > Math.abs(self.y)? self.x : self.y);
self.value = self.initialValue + ( self.movement * self.options.scale);
- if (self.options.forceint)
- self.value = parseInt( self.value );
-
self.render();
},
@@ -271,6 +268,9 @@ var Knob = new Class({
render: function(v){
if (typeof v != 'undefined') this.value = parseFloat( v );
+ if (this.options.forceint)
+ this.value = parseInt( this.value );
+
if (this.options.range){
if (this.value < this.options.range[0]) this.value = this.options.range[0];
else if (this.value > this.options.range[1]) this.value = this.options.range[1];

0 comments on commit d3e5475

Please sign in to comment.
Something went wrong with that request. Please try again.