aboutsummaryrefslogtreecommitdiffstats
path: root/ui
diff options
context:
space:
mode:
authorRichard Worth <rdworth@gmail.com>2008-12-10 05:10:37 +0000
committerRichard Worth <rdworth@gmail.com>2008-12-10 05:10:37 +0000
commit38e213547245bc1186bce70b5b920e9dd7356c76 (patch)
tree4b9ad824827571ad2f757beb4a45f7b42b18a211 /ui
parentea1a018560c8c80d0cf4c09aca1ecc60382016af (diff)
downloadjquery-ui-38e213547245bc1186bce70b5b920e9dd7356c76.tar.gz
jquery-ui-38e213547245bc1186bce70b5b920e9dd7356c76.zip
core widget: added ui-state-disabled and aria-disabled to widget plugin's disable/enable/destroy
Diffstat (limited to 'ui')
-rw-r--r--ui/ui.core.js10
1 files changed, 7 insertions, 3 deletions
diff --git a/ui/ui.core.js b/ui/ui.core.js
index c277ed9b2..2835953da 100644
--- a/ui/ui.core.js
+++ b/ui/ui.core.js
@@ -1,4 +1,4 @@
-/*
+/*
* jQuery UI @VERSION
*
* Copyright (c) 2008 AUTHORS.txt (http://ui.jquery.com/about)
@@ -301,6 +301,7 @@ $.widget = function(name, prototype) {
$[namespace][name] = function(element, options) {
var self = this;
+ this.namespace = namespace;
this.widgetName = name;
this.widgetEventPrefix = $[namespace][name].eventPrefix || name;
this.widgetBaseClass = namespace + '-' + name;
@@ -336,7 +337,9 @@ $.widget = function(name, prototype) {
$.widget.prototype = {
_init: function() {},
destroy: function() {
- this.element.removeData(this.widgetName);
+ this.element.removeData(this.widgetName)
+ .removeClass(this.widgetBaseClass + '-disabled' + ' ' + this.namespace + '-state-disabled')
+ .removeAttr('aria-disabled');
},
option: function(key, value) {
@@ -363,7 +366,8 @@ $.widget.prototype = {
if (key == 'disabled') {
this.element[value ? 'addClass' : 'removeClass'](
- this.widgetBaseClass + '-disabled');
+ this.widgetBaseClass + '-disabled' + ' ' + this.namespace + '-state-disabled')
+ .attr("aria-disabled", value);
}
},