mirror of
https://github.com/jquery/jquery-ui.git
synced 2024-11-21 11:04:24 +00:00
Selectmenu: change dropdown style on the fly
This commit is contained in:
parent
5766261af2
commit
33bd0cd9fb
10
ui/jquery.ui.selectmenu.js
vendored
10
ui/jquery.ui.selectmenu.js
vendored
@ -172,11 +172,8 @@ $.widget( "ui.selectmenu", {
|
||||
this.menu.find( "li" ).not( '.ui-selectmenu-optgroup' ).find( 'a' ).attr( 'role', 'option' );
|
||||
this.menu.attr( "aria-activedescendant" , this.menu.find( "li.ui-menu-item a" ).eq( this.element[0].selectedIndex ).attr( "id" ) );
|
||||
|
||||
if ( this.options.dropdown ) {
|
||||
this.menu
|
||||
.addClass( 'ui-corner-bottom' )
|
||||
.removeClass( 'ui-corner-all' );
|
||||
}
|
||||
// change styles?
|
||||
this._setOption( "dropdown", this.options.dropdown );
|
||||
|
||||
// transfer disabled state
|
||||
if ( this.element.attr( 'disabled' ) ) {
|
||||
@ -392,6 +389,9 @@ $.widget( "ui.selectmenu", {
|
||||
if ( key === "appendTo" ) {
|
||||
this.menuWrap.appendTo( $( value || "body", this.element[0].ownerDocument )[0] );
|
||||
}
|
||||
if ( key === "dropdown" ) {
|
||||
this.menu.toggleClass( 'ui-corner-bottom', value ).toggleClass( 'ui-corner-all', !value );
|
||||
}
|
||||
if ( key === "disabled" ) {
|
||||
this.button.button( "option", "disabled", value );
|
||||
this.menu.menu( "option", "disabled", value );
|
||||
|
Loading…
Reference in New Issue
Block a user