Skip to content

Commit

Permalink
Selectmenu: change dropdown style on the fly
Browse files Browse the repository at this point in the history
  • Loading branch information
fnagel committed Jan 13, 2012
1 parent 5766261 commit 33bd0cd
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions ui/jquery.ui.selectmenu.js
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -171,12 +171,9 @@ $.widget( "ui.selectmenu", {
// adjust ARIA // adjust ARIA
this.menu.find( "li" ).not( '.ui-selectmenu-optgroup' ).find( 'a' ).attr( 'role', 'option' ); 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" ) ); this.menu.attr( "aria-activedescendant" , this.menu.find( "li.ui-menu-item a" ).eq( this.element[0].selectedIndex ).attr( "id" ) );


if ( this.options.dropdown ) { // change styles?
this.menu this._setOption( "dropdown", this.options.dropdown );
.addClass( 'ui-corner-bottom' )
.removeClass( 'ui-corner-all' );
}


// transfer disabled state // transfer disabled state
if ( this.element.attr( 'disabled' ) ) { if ( this.element.attr( 'disabled' ) ) {
Expand Down Expand Up @@ -392,6 +389,9 @@ $.widget( "ui.selectmenu", {
if ( key === "appendTo" ) { if ( key === "appendTo" ) {
this.menuWrap.appendTo( $( value || "body", this.element[0].ownerDocument )[0] ); 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" ) { if ( key === "disabled" ) {
this.button.button( "option", "disabled", value ); this.button.button( "option", "disabled", value );
this.menu.menu( "option", "disabled", value ); this.menu.menu( "option", "disabled", value );
Expand Down

0 comments on commit 33bd0cd

Please sign in to comment.