aboutsummaryrefslogtreecommitdiffstats
path: root/ui
diff options
context:
space:
mode:
authorFelix Nagel <info@felixnagel.com>2011-09-28 00:03:52 +0200
committerFelix Nagel <info@felixnagel.com>2011-09-28 00:18:36 +0200
commitfd69abb8d05b3ac8273834f33e9b02b8d9be3632 (patch)
tree6e287c2a279e11434cce675d6b9214514608509a /ui
parent68a369911a030ad010f71fbe96845d50a146b960 (diff)
downloadjquery-ui-fd69abb8d05b3ac8273834f33e9b02b8d9be3632.tar.gz
jquery-ui-fd69abb8d05b3ac8273834f33e9b02b8d9be3632.zip
Selectmenu: improved width handling and visual style
Diffstat (limited to 'ui')
-rw-r--r--ui/jquery.ui.selectmenu.js7
1 files changed, 4 insertions, 3 deletions
diff --git a/ui/jquery.ui.selectmenu.js b/ui/jquery.ui.selectmenu.js
index ccae38eea..a3a81ddcc 100644
--- a/ui/jquery.ui.selectmenu.js
+++ b/ui/jquery.ui.selectmenu.js
@@ -42,7 +42,7 @@ $.widget( "ui.selectmenu", {
_create: function() {
var self = this,
options = this.options,
- tabindex = this.element.attr( 'tabindex' )
+ tabindex = this.element.attr( 'tabindex' ),
// set a default id value, generate a new random one if not set by developer
selectmenuId = self.element.attr( 'id' ) || 'ui-selectmenu-' + Math.random().toString( 16 ).slice( 2, 10 );
@@ -72,7 +72,7 @@ $.widget( "ui.selectmenu", {
tabindex: ( tabindex ? tabindex : self.element.attr( 'disabled' ) ? 1 : 0 ),
id: self.ids[ 0 ],
css: {
- width: self.element.width()
+ width: self.element.outerWidth()
},
'aria-disabled': options.disabled,
'aria-owns': self.ids[ 1 ],
@@ -172,9 +172,10 @@ $.widget( "ui.selectmenu", {
});
// wrap list
+ var newelementWidth = self.newelement.outerWidth();
self.listWrap = $( options.wrapperElement )
.addClass( self.widgetBaseClass + '-menu' )
- .css( "width", ( options.dropdown ) ? self.element.width() : self.element.width() - options.iconWidth )
+ .width( ( options.dropdown ) ? newelementWidth : newelementWidth - options.iconWidth )
.append( self.list )
.appendTo( options.appendTo );