Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Selectmenu: remove button wrapper element

  • Loading branch information...
commit 66ba39094eef4ae5b380db06ab0aba13b71be761 1 parent 8fc08a1
@fnagel fnagel authored
Showing with 10 additions and 15 deletions.
  1. +3 −2 themes/base/jquery.ui.selectmenu.css
  2. +7 −13 ui/jquery.ui.selectmenu.js
View
5 themes/base/jquery.ui.selectmenu.css
@@ -11,7 +11,7 @@
.ui-selectmenu-menu {
padding: 0;
margin: 0;
- position:absolute;
+ position: absolute;
top: 0;
display: none;
}
@@ -35,11 +35,12 @@
.ui-selectmenu-open {
display: block;
}
-.ui-selectmenu-button .ui-button {
+.ui-selectmenu-button {
display: inline-block;
overflow: hidden;
position: relative;
text-decoration: none;
+ cursor: pointer;
}
.ui-selectmenu-button span.ui-icon {
right: 0.5em;
View
20 ui/jquery.ui.selectmenu.js
@@ -69,7 +69,7 @@ $.widget( "ui.selectmenu", {
// create button
this.button = $( "<span>", {
- "class": "ui-button ui-widget ui-state-default ui-corner-all",
+ "class": "ui-selectmenu-button ui-widget ui-state-default ui-corner-all",
tabindex: ( tabindex ? tabindex : this.options.disabled ? -1 : 0 ),
id: this.ids.button,
width: this.element.outerWidth(),
@@ -78,25 +78,19 @@ $.widget( "ui.selectmenu", {
"aria-autocomplete": "list",
"aria-owns": this.ids.menu,
"aria-haspopup": true
- });
+ })
+ .insertAfter( this.element );
this.button.prepend( $( "<span>", {
"class": "ui-icon " + this.options.icons.button
}));
this.buttonText = $( "<span>", {
- "class": "ui-selectmenu-text"
- })
- .appendTo( this.button );
+ "class": "ui-selectmenu-text"
+ })
+ .appendTo( this.button );
this._setText( this.buttonText, this.element.find( "option:selected" ).text() );
- // wrap and insert new button
- this.buttonWrap = $( "<span>", {
- "class": "ui-selectmenu-button"
- })
- .append( this.button )
- .insertAfter( this.element );
-
this._on( this.button, this._buttonEvents );
this._hoverable( this.button );
this._focusable( this.button );
@@ -462,7 +456,7 @@ $.widget( "ui.selectmenu", {
_destroy: function() {
this.menuWrap.remove();
- this.buttonWrap.remove();
+ this.button.remove();
this.element.show();
this.element.removeUniqueId();
this.label.attr( "for", this.ids.id );
Please sign in to comment.
Something went wrong with that request. Please try again.