@@ -28,13 +28,13 @@ $.widget("ui.selectmenu", {
28
28
29
29
_create : function ( ) {
30
30
var self = this , o = this . options ;
31
-
31
+
32
32
// make / set unique id
33
33
var selectmenuId = this . element . uniqueId ( ) . attr ( "id" ) ;
34
34
35
35
// quick array of button and menu id's
36
36
this . ids = [ selectmenuId , selectmenuId + '-button' , selectmenuId + '-menu' ] ;
37
-
37
+
38
38
// define safe mouseup for future toggling
39
39
this . _safemouseup = true ;
40
40
this . isOpen = false ;
@@ -714,37 +714,37 @@ $.widget("ui.selectmenu", {
714
714
} ,
715
715
716
716
disable : function ( index , type ) {
717
- // if options is not provided, call the parents disable function
718
- if ( typeof ( index ) == 'undefined' ) {
719
- this . _setOption ( 'disabled' , true ) ;
720
- } else {
721
- this . _toggleEnabled ( ( type || "option" ) , index , false ) ;
722
- }
717
+ // if options is not provided, call the parents disable function
718
+ if ( typeof ( index ) == 'undefined' ) {
719
+ this . _setOption ( 'disabled' , true ) ;
720
+ } else {
721
+ this . _toggleEnabled ( ( type || "option" ) , index , false ) ;
722
+ }
723
723
} ,
724
724
725
725
enable : function ( index , type ) {
726
- // if options is not provided, call the parents enable function
727
- if ( typeof ( index ) == 'undefined' ) {
728
- this . _setOption ( 'disabled' , false ) ;
729
- } else {
730
- this . _toggleEnabled ( ( type || "option" ) , index , true ) ;
731
- }
726
+ // if options is not provided, call the parents enable function
727
+ if ( typeof ( index ) == 'undefined' ) {
728
+ this . _setOption ( 'disabled' , false ) ;
729
+ } else {
730
+ this . _toggleEnabled ( ( type || "option" ) , index , true ) ;
731
+ }
732
732
} ,
733
733
734
734
_disabled : function ( elem ) {
735
- return $ ( elem ) . hasClass ( 'ui-state-disabled' ) ;
735
+ return $ ( elem ) . hasClass ( 'ui-state-disabled' ) ;
736
736
} ,
737
-
737
+
738
738
// true = enabled, false = disabled
739
739
_toggleEnabled : function ( type , index , flag ) {
740
740
var element = this . element . find ( type ) . eq ( index ) ,
741
741
elements = ( type === "optgroup" ) ? this . list . find ( 'li.ui-selectmenu-group-' + index ) : this . _optionLis . eq ( index ) ;
742
-
742
+
743
743
if ( elements ) {
744
744
elements
745
745
. toggleClass ( 'ui-state-disabled' , ! flag )
746
746
. attr ( "aria-disabled" , ! flag ) ;
747
-
747
+
748
748
if ( flag ) {
749
749
element . removeAttr ( "disabled" ) ;
750
750
} else {
0 commit comments