aboutsummaryrefslogtreecommitdiffstats
path: root/ui
diff options
context:
space:
mode:
authorScott González <scott.gonzalez@gmail.com>2010-10-21 22:15:13 -0400
committerScott González <scott.gonzalez@gmail.com>2010-10-21 22:15:13 -0400
commita0c856467d7cb19442ac24a5e8eda5a504d474d6 (patch)
tree727a570997fd6b69706fa428277654a083a49564 /ui
parent6ba75aa698361bf8c87ac7037570a5daaad3b49a (diff)
downloadjquery-ui-a0c856467d7cb19442ac24a5e8eda5a504d474d6.tar.gz
jquery-ui-a0c856467d7cb19442ac24a5e8eda5a504d474d6.zip
Autocomplete: Split menu resizing logic into its own method to create a more logical method to proxy for custom sizing.
Diffstat (limited to 'ui')
-rw-r--r--ui/jquery.ui.autocomplete.js18
1 files changed, 11 insertions, 7 deletions
diff --git a/ui/jquery.ui.autocomplete.js b/ui/jquery.ui.autocomplete.js
index e992aadc3..427ad1a5a 100644
--- a/ui/jquery.ui.autocomplete.js
+++ b/ui/jquery.ui.autocomplete.js
@@ -326,10 +326,8 @@ $.widget( "ui.autocomplete", {
_suggest: function( items ) {
var ul = this.menu.element
- .empty()
- .zIndex( this.element.zIndex() + 1 ),
- menuWidth,
- textWidth;
+ .empty()
+ .zIndex( this.element.zIndex() + 1 );
this._renderMenu( ul, items );
// TODO refresh should check if the active item is still in the dom, removing the need for a manual deactivate
this.menu.deactivate();
@@ -338,9 +336,15 @@ $.widget( "ui.autocomplete", {
of: this.element
}, this.options.position ));
- menuWidth = ul.width( "" ).outerWidth();
- textWidth = this.element.outerWidth();
- ul.outerWidth( Math.max( menuWidth, textWidth ) );
+ this._resizeMenu();
+ },
+
+ _resizeMenu: function() {
+ var ul = this.menu.element;
+ ul.outerWidth( Math.max(
+ ul.width( "" ).outerWidth(),
+ this.element.outerWidth()
+ ) );
},
_renderMenu: function( ul, items ) {