aboutsummaryrefslogtreecommitdiffstats
path: root/ui/widgets
diff options
context:
space:
mode:
authorAlexander Schmitz <arschmitz@gmail.com>2014-08-22 16:40:09 -0400
committerAlexander Schmitz <arschmitz@gmail.com>2015-10-07 10:57:59 -0400
commit9f7f0a427966741a460e91336947698879f8ad77 (patch)
treea7e34fd8a735149dc684b08e7fec087db4f886d7 /ui/widgets
parent897ec38e6327393e8bac197a66e5c54bf883600f (diff)
downloadjquery-ui-9f7f0a427966741a460e91336947698879f8ad77.tar.gz
jquery-ui-9f7f0a427966741a460e91336947698879f8ad77.zip
Selectmenu: update to use button css
This ensures consistency between different form elements
Diffstat (limited to 'ui/widgets')
-rw-r--r--ui/widgets/selectmenu.js13
1 files changed, 7 insertions, 6 deletions
diff --git a/ui/widgets/selectmenu.js b/ui/widgets/selectmenu.js
index 30d8c71af..e57354f2e 100644
--- a/ui/widgets/selectmenu.js
+++ b/ui/widgets/selectmenu.js
@@ -13,7 +13,7 @@
//>>docs: http://api.jqueryui.com/selectmenu/
//>>demos: http://jqueryui.com/selectmenu/
//>>css.structure: ../themes/base/core.css
-//>>css.structure: ../themes/base/selectmenu.css
+//>>css.structure: ../themes/base/selectmenu.css, ../themes/base/button.css
//>>css.theme: ../themes/base/theme.css
( function( factory ) {
@@ -82,7 +82,7 @@ return $.widget( "ui.selectmenu", {
},
_drawButton: function() {
- var icon,
+ var icon, space,
that = this,
item = this._parseOption(
this.element.find( "option:selected" ),
@@ -115,10 +115,13 @@ return $.widget( "ui.selectmenu", {
.insertAfter( this.element );
this._addClass( this.button, "ui-selectmenu-button ui-selectmenu-button-closed",
- "ui-widget ui-state-default" );
+ "ui-button ui-widget" );
icon = $( "<span>" ).prependTo( this.button );
+ space = $( "<span> </span>" );
+ this._addClass( space, "ui-selectmenu-icon-space" );
this._addClass( icon, null, "ui-icon " + this.options.icons.button );
+ icon.after( space );
this.buttonItem = this._renderButtonItem( item )
.appendTo( this.button );
@@ -136,8 +139,6 @@ return $.widget( "ui.selectmenu", {
that._refreshMenu();
}
} );
- this._hoverable( this.button );
- this._focusable( this.button );
},
_drawMenu: function() {
@@ -606,7 +607,7 @@ return $.widget( "ui.selectmenu", {
// we always remove classes first and add them second, otherwise if both classes have the
// same theme class, it will be removed after we add it.
this._removeClass( this.button, "ui-selectmenu-button-" +
- ( this.isOpen ? "closed" : "open" ) )
+ ( this.isOpen ? "closed" : "open" ) )
._addClass( this.button, "ui-selectmenu-button-" +
( this.isOpen ? "open" : "closed" ) )
._toggleClass( this.menuWrap, "ui-selectmenu-open", null, this.isOpen );