aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFelix Nagel <info@felixnagel.com>2012-01-13 20:13:58 +0100
committerFelix Nagel <info@felixnagel.com>2012-01-13 20:13:58 +0100
commit33bd0cd9fb4c2ad32c44686ad2bf8aeee6a64271 (patch)
treeddb00040dbbab56ab9babbacec5754245c775027
parent5766261af2767862ab6750e5eb8d6a927ced50ae (diff)
downloadjquery-ui-33bd0cd9fb4c2ad32c44686ad2bf8aeee6a64271.tar.gz
jquery-ui-33bd0cd9fb4c2ad32c44686ad2bf8aeee6a64271.zip
Selectmenu: change dropdown style on the fly
-rw-r--r--ui/jquery.ui.selectmenu.js12
1 files changed, 6 insertions, 6 deletions
diff --git a/ui/jquery.ui.selectmenu.js b/ui/jquery.ui.selectmenu.js
index fbfd92bd0..9f5d3db37 100644
--- a/ui/jquery.ui.selectmenu.js
+++ b/ui/jquery.ui.selectmenu.js
@@ -171,12 +171,9 @@ $.widget( "ui.selectmenu", {
// adjust ARIA
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 );