@@ -79,10 +79,6 @@ return $.widget( "ui.selectmenu", {
79
79
80
80
this . _rendered = false ;
81
81
this . menuItems = $ ( ) ;
82
-
83
- if ( this . options . disabled ) {
84
- this . disable ( ) ;
85
- }
86
82
} ,
87
83
88
84
_drawButton : function ( ) {
@@ -563,24 +559,30 @@ return $.widget( "ui.selectmenu", {
563
559
}
564
560
565
561
if ( key === "disabled" ) {
566
- this . menuInstance . option ( "disabled" , value ) ;
567
- this . button . attr ( "aria-disabled" , value ) ;
568
- this . _toggleClass ( this . button , null , "ui-state-disabled" , value ) ;
569
-
570
- this . element . prop ( "disabled" , value ) ;
571
- if ( value ) {
572
- this . button . attr ( "tabindex" , - 1 ) ;
573
- this . close ( ) ;
574
- } else {
575
- this . button . attr ( "tabindex" , 0 ) ;
576
- }
562
+ this . _setOptionDisabled ( value ) ;
577
563
}
578
564
579
565
if ( key === "width" ) {
580
566
this . _resizeButton ( ) ;
581
567
}
582
568
} ,
583
569
570
+ _setOptionDisabled : function ( value ) {
571
+ this . _super ( value ) ;
572
+
573
+ this . menuInstance . option ( "disabled" , value ) ;
574
+ this . button . attr ( "aria-disabled" , value ) ;
575
+ this . _toggleClass ( this . button , null , "ui-state-disabled" , value ) ;
576
+
577
+ this . element . prop ( "disabled" , value ) ;
578
+ if ( value ) {
579
+ this . button . attr ( "tabindex" , - 1 ) ;
580
+ this . close ( ) ;
581
+ } else {
582
+ this . button . attr ( "tabindex" , 0 ) ;
583
+ }
584
+ } ,
585
+
584
586
_appendTo : function ( ) {
585
587
var element = this . options . appendTo ;
586
588
0 commit comments