mirror of
https://github.com/rsyslog/loganalyzer.git
synced 2025-09-26 11:19:26 +02:00
Added code to automhide all open menus on other menu click
This commit is contained in:
parent
0ce99c2545
commit
8ba569b1eb
@ -447,9 +447,15 @@ function CreateMenuFunction ( szbuttonobjid, szmenuobjid, bHide )
|
||||
// Hide
|
||||
menu.hide();
|
||||
}
|
||||
|
||||
|
||||
$(szbuttonobjid).button()
|
||||
.click(function() {
|
||||
|
||||
/* Hide all other Menus first!*/
|
||||
$('ul[id^="menu"]').each(function () {
|
||||
$(this).hide();
|
||||
});
|
||||
|
||||
// Make use of the general purpose show and position operations
|
||||
// open and place the menu where we want.
|
||||
menu.show().position({
|
||||
@ -462,14 +468,14 @@ function CreateMenuFunction ( szbuttonobjid, szmenuobjid, bHide )
|
||||
|
||||
// Register a click outside the menu to close it
|
||||
$( document ).on( "click", function() {
|
||||
menu.hide();
|
||||
menu.hide();
|
||||
});
|
||||
|
||||
// Helper function to close a menu by escape key
|
||||
$( document ).keyup(function(e) {
|
||||
if (e.keyCode == 27) {
|
||||
menu.hide();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
// Helper function to click a link by keypress
|
||||
@ -488,8 +494,7 @@ function CreateMenuFunction ( szbuttonobjid, szmenuobjid, bHide )
|
||||
}
|
||||
});
|
||||
|
||||
// Make sure to return false here or the click registration
|
||||
// above gets invoked.
|
||||
// Make sure to return false here or the click registration above gets invoked.
|
||||
return false;
|
||||
})
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user