diff options
author | Felix Nagel <info@felixnagel.com> | 2013-03-07 23:53:15 +0100 |
---|---|---|
committer | Felix Nagel <info@felixnagel.com> | 2013-03-07 23:53:15 +0100 |
commit | 66ba39094eef4ae5b380db06ab0aba13b71be761 (patch) | |
tree | 8669da0064e7ae8fc1f8ab320ef86906f7e363ef | |
parent | 8fc08a18ecb19e84c7a1eac715221427094e68f1 (diff) | |
download | jquery-ui-66ba39094eef4ae5b380db06ab0aba13b71be761.tar.gz jquery-ui-66ba39094eef4ae5b380db06ab0aba13b71be761.zip |
Selectmenu: remove button wrapper element
-rw-r--r-- | themes/base/jquery.ui.selectmenu.css | 5 | ||||
-rw-r--r-- | ui/jquery.ui.selectmenu.js | 20 |
2 files changed, 10 insertions, 15 deletions
diff --git a/themes/base/jquery.ui.selectmenu.css b/themes/base/jquery.ui.selectmenu.css index 3256025a0..d19b5e07a 100644 --- a/themes/base/jquery.ui.selectmenu.css +++ b/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; diff --git a/ui/jquery.ui.selectmenu.js b/ui/jquery.ui.selectmenu.js index 91bbddadb..812905675 100644 --- a/ui/jquery.ui.selectmenu.js +++ b/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 ); |