var speedB2 = $('select#speedB2').selectmenu();
$("#optionSwitch").toggle(
function(){
- speedB2.selectmenu("enable", 2);
+ speedB2.selectmenu("disable", 2);
},
function(){
- speedB2.selectmenu("disable", 2);
+ speedB2.selectmenu("enable", 2);
}
);
var speedD2 = $('select#speedD2').selectmenu();
$("#optgroupSwitch").toggle(
function(){
- speedD2.selectmenu("enable", 1, "optgroup");
+ speedD2.selectmenu("disable", 1, "optgroup");
},
function(){
- speedD2.selectmenu("disable", 1, "optgroup");
+ speedD2.selectmenu("enable", 1, "optgroup");
}
);
var optionElem = this._optionLis.eq( index );
if ( optionElem ) {
optionElem
- .toggleClass( 'ui-state-disabled', flag )
- .find( "a" ).attr( "aria-disabled", !flag );
+ .toggleClass( 'ui-state-disabled', !flag )
+ .find( "a" ).attr( "aria-disabled", flag );
if ( flag ) {
- this.element.find( "option" ).eq( index ).attr( "disabled", "disabled" );
- } else {
this.element.find( "option" ).eq( index ).removeAttr( "disabled" );
+ } else {
+ this.element.find( "option" ).eq( index ).attr( "disabled", "disabled" );
}
}
},
var optGroupElem = this.list.find( 'li.ui-selectmenu-group-' + index );
if ( optGroupElem ) {
optGroupElem
- .toggleClass( 'ui-state-disabled', flag )
- .attr( "aria-disabled", !flag );
+ .toggleClass( 'ui-state-disabled', !flag )
+ .attr( "aria-disabled", flag );
if ( flag ) {
- this.element.find( "optgroup" ).eq( index ).attr( "disabled", "disabled" );
- } else {
this.element.find( "optgroup" ).eq( index ).removeAttr( "disabled" );
+ } else {
+ this.element.find( "optgroup" ).eq( index ).attr( "disabled", "disabled" );
}
}
},