On show hide any other ULS menus visible

This commit is contained in:
Santhosh Thottingal
2012-11-21 17:09:12 +05:30
parent 4f37bd2f1e
commit b3a3f48c3b

View File

@@ -145,6 +145,10 @@
this.defaultSearch(); this.defaultSearch();
this.initialized = true; this.initialized = true;
} }
// hide any other ULS visible
$( '.uls-menu' ).hide();
this.$menu.show(); this.$menu.show();
this.shown = true; this.shown = true;
@@ -206,8 +210,7 @@
*/ */
listen: function() { listen: function() {
var lcd, var lcd,
uls = this, uls = this;
cancelProxy = $.proxy( uls.cancel, uls );
// Register all event listeners to the ULS here. // Register all event listeners to the ULS here.
uls.$element.on( 'click', $.proxy( uls.click, uls ) ); uls.$element.on( 'click', $.proxy( uls.click, uls ) );
@@ -215,13 +218,14 @@
uls.$languageFilter.on( 'searchclear', $.proxy( uls.defaultSearch, uls ) ); uls.$languageFilter.on( 'searchclear', $.proxy( uls.defaultSearch, uls ) );
// Close when clicking on the close button // 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 // Don't do anything if pressing on empty space in the ULS
uls.$menu.on( 'click', function ( e ) { uls.$menu.on( 'click', function ( e ) {
e.stopPropagation(); e.stopPropagation();
} ); } );
// Close ULS if clicking elsewhere // Close ULS if clicking elsewhere
$( document ).on( 'click', cancelProxy ); $( document ).on( 'click', $.proxy( uls.cancel, uls ) );
// Handle key press events on the menu // Handle key press events on the menu
uls.$menu.on( 'keypress', $.proxy( this.keypress, this ) ) uls.$menu.on( 'keypress', $.proxy( this.keypress, this ) )