Skip to content
Permalink
Browse files

core widget: added ui-state-disabled and aria-disabled to widget plug…

…in's disable/enable/destroy
  • Loading branch information
rdworth committed Dec 10, 2008
1 parent ea1a018 commit 38e213547245bc1186bce70b5b920e9dd7356c76
Showing with 7 additions and 3 deletions.
  1. +7 −3 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);
}
},

0 comments on commit 38e2135

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