aboutsummaryrefslogtreecommitdiffstats
path: root/ui
diff options
context:
space:
mode:
authorScott González <scott.gonzalez@gmail.com>2008-06-04 19:59:38 +0000
committerScott González <scott.gonzalez@gmail.com>2008-06-04 19:59:38 +0000
commit0d01cc3691578c6b90cd324683114ea8bb74dc49 (patch)
tree69fa79057e181219bcdd7d433e7025f85e054db9 /ui
parent98f42fc80258bd8c9dc4299472889881e4be73fa (diff)
downloadjquery-ui-0d01cc3691578c6b90cd324683114ea8bb74dc49.tar.gz
jquery-ui-0d01cc3691578c6b90cd324683114ea8bb74dc49.zip
Slider: fixed #2552: Disabled should be an option, not a property on the instance.
Diffstat (limited to 'ui')
-rw-r--r--ui/source/ui.slider.js14
1 files changed, 3 insertions, 11 deletions
diff --git a/ui/source/ui.slider.js b/ui/source/ui.slider.js
index b836cc710..5fe59b587 100644
--- a/ui/source/ui.slider.js
+++ b/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() };