From 0d282630de1fa9b2cd937a0743c727903979e837 Mon Sep 17 00:00:00 2001 From: Felix Nagel Date: Thu, 29 Nov 2012 20:57:44 +0100 Subject: Selectmenu: make isOpen check a guard clause in close method --- ui/jquery.ui.selectmenu.js | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'ui/jquery.ui.selectmenu.js') diff --git a/ui/jquery.ui.selectmenu.js b/ui/jquery.ui.selectmenu.js index a6ce85f0c..80f40fb23 100644 --- a/ui/jquery.ui.selectmenu.js +++ b/ui/jquery.ui.selectmenu.js @@ -233,13 +233,15 @@ $.widget( "ui.selectmenu", { close: function( event ) { if ( this.isOpen ) { - var id = this._getSelectedItem().find( "a" ).attr( "id" ); - this.isOpen = false; - this._toggleAttr(); - this.button.attr( "aria-activedescendant", id ); - this.menu.attr( "aria-activedescendant", id ); - this._trigger( "close", event ); + return false; } + + var id = this._getSelectedItem().find( "a" ).attr( "id" ); + this.isOpen = false; + this._toggleAttr(); + this.button.attr( "aria-activedescendant", id ); + this.menu.attr( "aria-activedescendant", id ); + this._trigger( "close", event ); }, widget: function() { -- cgit v1.2.3