Skip to content
Permalink
Browse files

Selectmenu: Add support for setOption with classes

  • Loading branch information
arschmitz committed Oct 15, 2014
1 parent 7714df9 commit 16660812e7f5134173fe38e8df4c1542fc9a8c1b
Showing with 33 additions and 4 deletions.
  1. +33 −4 ui/selectmenu.js
@@ -35,10 +35,10 @@ return $.widget( "ui.selectmenu", {
"ui-selectmenu-button": "",
"ui-selectmenu-button-open": "ui-corner-top",
"ui-selectmenu-button-closed": "ui-corner-all",
"ui-selectmenu-text": null,
"ui-selectmenu-menu": null,
"ui-selectmenu-optgroup": null,
"ui-selectmenu-open": null
"ui-selectmenu-text": "",
"ui-selectmenu-menu": "",
"ui-selectmenu-optgroup": "",
"ui-selectmenu-open": ""
},
disabled: null,
icons: {
@@ -507,6 +507,35 @@ return $.widget( "ui.selectmenu", {
this.menu.attr( "aria-activedescendant", id );
},

_elementsFromClassKey: function( classKey ) {
switch ( classKey ) {
case "ui-selectmenu-button":
return this.button;
case "ui-selectmenu-button-open":
if ( this.isOpen ) {
return this.button;
}
return $();
case "ui-selectmenu-button-closed":
if ( !this.isOpen ) {
return this.button;
}
return $();
case "ui-selectmenu-text":
return this.buttonText;
case "ui-selectmenu-menu":
return this.menu;
case "ui-selectmenu-optgroup":
return this.menu.find( classKey );
case "ui-selectmenu-open":
if ( this.isOpen ) {
return this.menuWrap;
}
return $();
}
return this._superApply( arguments );
},

_setOption: function( key, value ) {
if ( key === "icons" ) {
this.button.find( "span.ui-icon" )

0 comments on commit 1666081

Please sign in to comment.
You can’t perform that action at this time.