aboutsummaryrefslogtreecommitdiffstats
path: root/ui/jquery.ui.selectmenu.js
diff options
context:
space:
mode:
authorFelix Nagel <info@felixnagel.com>2012-02-25 00:15:28 +0100
committerFelix Nagel <info@felixnagel.com>2012-02-25 00:15:28 +0100
commitc0f9dd31e9ae551f0b4b921435f3ef6981b9da77 (patch)
treef116662014bb965d9f050884a7a38bfc495647ea /ui/jquery.ui.selectmenu.js
parentb356e1e4e19abb5cbc97350d29d954e3a7ebd4b6 (diff)
downloadjquery-ui-c0f9dd31e9ae551f0b4b921435f3ef6981b9da77.tar.gz
jquery-ui-c0f9dd31e9ae551f0b4b921435f3ef6981b9da77.zip
Selectmenu: unbind Menu document click event (fires unwanted focus event)
Diffstat (limited to 'ui/jquery.ui.selectmenu.js')
-rw-r--r--ui/jquery.ui.selectmenu.js12
1 files changed, 4 insertions, 8 deletions
diff --git a/ui/jquery.ui.selectmenu.js b/ui/jquery.ui.selectmenu.js
index fbb90662e..ccaa05e91 100644
--- a/ui/jquery.ui.selectmenu.js
+++ b/ui/jquery.ui.selectmenu.js
@@ -154,6 +154,9 @@ $.widget( "ui.selectmenu", {
// change menu styles?
this._setOption( "dropdown", this.options.dropdown );
+ // unbind Menu document event
+ $( document ).unbind( "click.menu" );
+
// document click closes menu
this._bind( document, {
click: function( event ) {
@@ -204,15 +207,8 @@ $.widget( "ui.selectmenu", {
// check if menu has items
if ( this.items ) {
- var currentItem = this._getSelectedItem();
- // needs to be fired after the document click event has closed all other Selectmenus
- // otherwise the current item is not indicated
- // TODO check if this should be handled by Menu
- this._delay( function(){
- this.menu.menu( "focus", event, currentItem );
- }, 1);
-
if ( !this.options.dropdown ) {
+ var currentItem = this._getSelectedItem();
// center current item
if ( this.menu.outerHeight() < this.menu.prop( "scrollHeight" ) ) {
this.menuWrap.css( "left" , -10000 );