Skip to content

Commit

Permalink
configurable min/max value for knob
Browse files Browse the repository at this point in the history
  • Loading branch information
Jason Frame committed Mar 12, 2014
1 parent 33e5a9e commit a13c245
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions lib/Knob/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,36 @@ exports.initialize = function(ctx, k, theme) {
this._redraw();

},

setMinValue: function(min) {

if (min === this._minValue) {
return;
}

this._minValue = min;
if (this._value < min) {
this._value = min;
}

this._redraw();

},

setMaxValue: function(max) {

if (max === this._maxValue) {
return;
}

this._maxValue = max;
if (this._value > max) {
this._value = max;
}

this._redraw();

},

_buildStructure: function() {

Expand Down

0 comments on commit a13c245

Please sign in to comment.