diff options
author | Felix Nagel <info@felixnagel.com> | 2011-06-16 23:51:17 +0200 |
---|---|---|
committer | Felix Nagel <info@felixnagel.com> | 2011-06-16 23:51:17 +0200 |
commit | b2d02482fa950cb51524312e4b2ec43a6eacee46 (patch) | |
tree | 3fcdb53463cdec58ac6764ba76717d2851612c8a | |
parent | f2865c1f51c70e71b28043d6a2e317f5cad099b6 (diff) | |
download | jquery-ui-b2d02482fa950cb51524312e4b2ec43a6eacee46.tar.gz jquery-ui-b2d02482fa950cb51524312e4b2ec43a6eacee46.zip |
fixed: some issue with height and refresh, thx to trollix, see: https://github.com/fnagel/jquery-ui/issues/133
-rw-r--r-- | ui/jquery.ui.selectmenu.js | 34 |
1 files changed, 22 insertions, 12 deletions
diff --git a/ui/jquery.ui.selectmenu.js b/ui/jquery.ui.selectmenu.js index 061a979e3..7e3ba1689 100644 --- a/ui/jquery.ui.selectmenu.js +++ b/ui/jquery.ui.selectmenu.js @@ -366,19 +366,29 @@ $.widget("ui.selectmenu", { this.list.width(o.menuWidth ? o.menuWidth : o.width - o.handleWidth); } - // calculate default max height - if (o.maxHeight) { - // set max height from option - if (o.maxHeight < this.list.height()) { - this.list.height(o.maxHeight); - } + // reset height to auto + this.list.css("height", "auto"); + var listH = this.list.height(); + + if ( o.maxHeight && o.maxHeight < listH) { + this.list.height( o.maxHeight ); } else { - if (!o.format && ($(window).height() / 3) < this.list.height()) { - o.maxHeight = $(window).height() / 3; - this.list.height(o.maxHeight); - } - } - + var winH = $( window ).height() / 3; + if ( winH < listH ) this.list.height( winH ); + } + + // if ( o.maxHeight ) { + // if (o.maxHeight < listH) { + // this.list.height( o.maxHeight ); + // } + // } else { + // var winH = $( window ).height() / 3; + // if ( winH < listH ) { + // this.list.height( winH ); + // console.log("set height (winH): " + winH); + // } + // } + // save reference to actionable li's (not group label li's) this._optionLis = this.list.find('li:not(.' + self.widgetBaseClass + '-group)'); |