Skip to content

Commit 33bd0cd

Browse files
committed
Selectmenu: change dropdown style on the fly
1 parent 5766261 commit 33bd0cd

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

ui/jquery.ui.selectmenu.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -171,12 +171,9 @@ $.widget( "ui.selectmenu", {
171171
// adjust ARIA
172172
this.menu.find( "li" ).not( '.ui-selectmenu-optgroup' ).find( 'a' ).attr( 'role', 'option' );
173173
this.menu.attr( "aria-activedescendant" , this.menu.find( "li.ui-menu-item a" ).eq( this.element[0].selectedIndex ).attr( "id" ) );
174-
175-
if ( this.options.dropdown ) {
176-
this.menu
177-
.addClass( 'ui-corner-bottom' )
178-
.removeClass( 'ui-corner-all' );
179-
}
174+
175+
// change styles?
176+
this._setOption( "dropdown", this.options.dropdown );
180177

181178
// transfer disabled state
182179
if ( this.element.attr( 'disabled' ) ) {
@@ -392,6 +389,9 @@ $.widget( "ui.selectmenu", {
392389
if ( key === "appendTo" ) {
393390
this.menuWrap.appendTo( $( value || "body", this.element[0].ownerDocument )[0] );
394391
}
392+
if ( key === "dropdown" ) {
393+
this.menu.toggleClass( 'ui-corner-bottom', value ).toggleClass( 'ui-corner-all', !value );
394+
}
395395
if ( key === "disabled" ) {
396396
this.button.button( "option", "disabled", value );
397397
this.menu.menu( "option", "disabled", value );

0 commit comments

Comments
 (0)