Skip to content
Permalink
Browse files

Slider: fixed #2552: Disabled should be an option, not a property on …

…the instance.
  • Loading branch information
scottgonzalez committed Jun 4, 2008
1 parent 98f42fc commit 0d01cc3691578c6b90cd324683114ea8bb74dc49
Showing with 3 additions and 11 deletions.
  1. +3 −11 ui/source/ui.slider.js
@@ -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();
}
@@ -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
@@ -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() };

0 comments on commit 0d01cc3

Please sign in to comment.
You can’t perform that action at this time.