Skip to content

Commit

Permalink
Slider: fixed #2552: Disabled should be an option, not a property on …
Browse files Browse the repository at this point in the history
…the instance.
  • Loading branch information
scottgonzalez committed Jun 4, 2008
1 parent 98f42fc commit 0d01cc3
Showing 1 changed file with 3 additions and 11 deletions.
14 changes: 3 additions & 11 deletions ui/source/ui.slider.js
Expand Up @@ -49,16 +49,8 @@ $.widget("ui.slider", {
.mouse("destroy");
this.generated && this.generated.remove();
},
enable: function() {
this.element.removeClass("ui-slider-disabled");
this.disabled = false;
},
disable: function() {
this.element.addClass("ui-slider-disabled");
this.disabled = true;
},
setData: function(key, value) {
this.options[key] = value;
$.widget.prototype.setData.apply(this, arguments);
if (/min|max|steps/.test(key)) {
this.initBoundaries();
}
Expand Down Expand Up @@ -184,7 +176,7 @@ $.widget("ui.slider", {
if(this == e.target)
clickedHandle = true;
});
if (clickedHandle || this.disabled || !(this.currentHandle || this.previousHandle))
if (clickedHandle || this.options.disabled || !(this.currentHandle || this.previousHandle))
return;

// If a previous handle was focussed, focus it again
Expand Down Expand Up @@ -277,7 +269,7 @@ $.widget("ui.slider", {
start: function(e, handle) {

var o = this.options;
if(this.disabled) return false;
if(o.disabled) return false;

// Prepare the outer size
this.actualSize = { width: this.element.outerWidth() , height: this.element.outerHeight() };
Expand Down

0 comments on commit 0d01cc3

Please sign in to comment.