From 8c17f74a1e64e134108f790d2527df18284ac9cc Mon Sep 17 00:00:00 2001 From: Felix Nagel Date: Wed, 11 Jan 2012 20:53:02 +0100 Subject: Selectmenu: create menu items with first opening to increase performance --- ui/jquery.ui.selectmenu.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'ui/jquery.ui.selectmenu.js') 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 ) { -- cgit v1.2.3