diff options
author | Felix Nagel <info@felixnagel.com> | 2011-09-28 22:22:36 +0200 |
---|---|---|
committer | Felix Nagel <info@felixnagel.com> | 2011-09-28 22:22:36 +0200 |
commit | 7f8f3212985edd4150a23c659da068f581d5d7db (patch) | |
tree | ab0773bf5b0af2861753e23cd9879bfc58016192 | |
parent | 3e1557b654e88852ef405422d13eb035dc33e929 (diff) | |
download | jquery-ui-7f8f3212985edd4150a23c659da068f581d5d7db.tar.gz jquery-ui-7f8f3212985edd4150a23c659da068f581d5d7db.zip |
Selectmenu: removed iconWidth
-rw-r--r-- | ui/jquery.ui.selectmenu.js | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/ui/jquery.ui.selectmenu.js b/ui/jquery.ui.selectmenu.js index 74ef8fa0a..10e543f42 100644 --- a/ui/jquery.ui.selectmenu.js +++ b/ui/jquery.ui.selectmenu.js @@ -21,7 +21,6 @@ $.widget( "ui.selectmenu", { defaultElement: "<select>", options: { dropdown: true, - iconWidth: 26, wrapperElement: "<div />", appendTo: "body", position: { @@ -169,11 +168,16 @@ $.widget( "ui.selectmenu", { id: self.ids[1] }); - // wrap list - var newelementWidth = self.newelement.outerWidth(); + // wrap list + if ( options.dropdown ) { + var setWidth = self.newelement.outerWidth(); + } else { + var text = self.newelement.find( "span.ui-button-text"); + var setWidth = text.width() + parseFloat( text.css( "padding-left" ) ) + parseFloat( text.css( "margin-left" ) ); + } self.listWrap = $( options.wrapperElement ) .addClass( self.widgetBaseClass + '-menu' ) - .width( ( options.dropdown ) ? newelementWidth : newelementWidth - options.iconWidth ) + .width( setWidth ) .append( self.list ) .appendTo( options.appendTo ); |