From b3a3f48c3b45e9c7ddaf5bc4d3801e25e0602c82 Mon Sep 17 00:00:00 2001 From: Santhosh Thottingal Date: Wed, 21 Nov 2012 17:09:12 +0530 Subject: [PATCH] On show hide any other ULS menus visible --- src/jquery.uls.core.js | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/jquery.uls.core.js b/src/jquery.uls.core.js index 8ed6bef..7e1c382 100644 --- a/src/jquery.uls.core.js +++ b/src/jquery.uls.core.js @@ -145,6 +145,10 @@ this.defaultSearch(); this.initialized = true; } + + // hide any other ULS visible + $( '.uls-menu' ).hide(); + this.$menu.show(); this.shown = true; @@ -206,8 +210,7 @@ */ listen: function() { var lcd, - uls = this, - cancelProxy = $.proxy( uls.cancel, uls ); + uls = this; // Register all event listeners to the ULS here. uls.$element.on( 'click', $.proxy( uls.click, uls ) ); @@ -215,13 +218,14 @@ uls.$languageFilter.on( 'searchclear', $.proxy( uls.defaultSearch, uls ) ); // Close when clicking on the close button - uls.$menu.find( '#uls-close' ).on( 'click', cancelProxy ); + uls.$menu.find( '#uls-close' ).on( 'click', $.proxy( uls.cancel, uls ) ); // Don't do anything if pressing on empty space in the ULS uls.$menu.on( 'click', function ( e ) { e.stopPropagation(); } ); + // Close ULS if clicking elsewhere - $( document ).on( 'click', cancelProxy ); + $( document ).on( 'click', $.proxy( uls.cancel, uls ) ); // Handle key press events on the menu uls.$menu.on( 'keypress', $.proxy( this.keypress, this ) )