aboutsummaryrefslogtreecommitdiffstats
path: root/ui
diff options
context:
space:
mode:
authorFelix Nagel <info@felixnagel.com>2012-01-11 20:53:02 +0100
committerFelix Nagel <info@felixnagel.com>2012-01-11 20:53:02 +0100
commit8c17f74a1e64e134108f790d2527df18284ac9cc (patch)
treeabb74a55e7b180bfa8c37bad04cd8e4fd1008df8 /ui
parentdb4acf61d14210360fdebda602297bc2bdc959ed (diff)
downloadjquery-ui-8c17f74a1e64e134108f790d2527df18284ac9cc.tar.gz
jquery-ui-8c17f74a1e64e134108f790d2527df18284ac9cc.zip
Selectmenu: create menu items with first opening to increase performance
Diffstat (limited to 'ui')
-rw-r--r--ui/jquery.ui.selectmenu.js7
1 files changed, 6 insertions, 1 deletions
diff --git a/ui/jquery.ui.selectmenu.js b/ui/jquery.ui.selectmenu.js
index 511760972..b116caa1e 100644
--- a/ui/jquery.ui.selectmenu.js
+++ b/ui/jquery.ui.selectmenu.js
@@ -62,7 +62,6 @@ $.widget( "ui.selectmenu", {
this._bind( this.button, this._buttonEvents );
this._drawMenu();
- this.refresh();
},
_drawButton: function() {
@@ -191,6 +190,12 @@ $.widget( "ui.selectmenu", {
},
open: function( event ) {
+ // init menu when initial opened
+ if ( !this.wasOpen ) {
+ this.refresh();
+ this.wasOpen = true;
+ }
+
var currentItem = this._getSelectedItem();
if ( !this.options.disabled ) {