aboutsummaryrefslogtreecommitdiffstats
path: root/ui
diff options
context:
space:
mode:
authorJörn Zaefferer <joern.zaefferer@gmail.com>2015-09-21 12:49:41 +0200
committerScott González <scott.gonzalez@gmail.com>2015-09-25 13:47:04 -0400
commit8d031215c6cf62f6fc6d9c9257d1e3c2d4f8b24a (patch)
tree31bcdd33812698c5ee9f23fad35f770c616ee87f /ui
parent83725a8fab70e1483b4001437e50ff0cb29df73b (diff)
downloadjquery-ui-8d031215c6cf62f6fc6d9c9257d1e3c2d4f8b24a.tar.gz
jquery-ui-8d031215c6cf62f6fc6d9c9257d1e3c2d4f8b24a.zip
Menu: Remove redundant handling of disabled option on create
Ref #9151 Ref gh-1599
Diffstat (limited to 'ui')
-rw-r--r--ui/widgets/menu.js16
1 files changed, 7 insertions, 9 deletions
diff --git a/ui/widgets/menu.js b/ui/widgets/menu.js
index f7fa2b651..d42d65bac 100644
--- a/ui/widgets/menu.js
+++ b/ui/widgets/menu.js
@@ -71,11 +71,6 @@ return $.widget( "ui.menu", {
tabIndex: 0
} );
- if ( this.options.disabled ) {
- this._addClass( null, "ui-state-disabled" );
- this.element.attr( "aria-disabled", "true" );
- }
-
this._addClass( "ui-menu", "ui-widget ui-widget-content" );
this._on( {
@@ -359,13 +354,16 @@ return $.widget( "ui.menu", {
this._removeClass( icons, null, this.options.icons.submenu )
._addClass( icons, null, value.submenu );
}
- if ( key === "disabled" ) {
- this.element.attr( "aria-disabled", value );
- this._toggleClass( null, "ui-state-disabled", !!value );
- }
this._super( key, value );
},
+ _setOptionDisabled: function( value ) {
+ this._super( value );
+
+ this.element.attr( "aria-disabled", String( value ) );
+ this._toggleClass( null, "ui-state-disabled", !!value );
+ },
+
focus: function( event, item ) {
var nested, focused, activeParent;
this.blur( event, event && event.type === "focus" );