mirror of
https://github.com/galaxyproject/galaxy.git
synced 2026-10-25 10:24:38 +08:00
Add js for mako based masthead
This commit is contained in:
@@ -5,6 +5,28 @@
|
||||
|
||||
<%def name="javascripts()">
|
||||
${parent.javascripts()}
|
||||
<script type="text/javascript">
|
||||
$(document).ready( function() {
|
||||
|
||||
// Masthead dropdown menus
|
||||
var $dropdowns = $("#masthead ul.nav > li.dropdown > .dropdown-menu");
|
||||
$("body").on( "click.nav_popups", function( e ) {
|
||||
$dropdowns.hide();
|
||||
$("#dd-helper").hide();
|
||||
// If the target is in the menu, treat normally
|
||||
if ( $(e.target).closest( "#masthead ul.nav > li.dropdown > .dropdown-menu" ).length ) {
|
||||
return;
|
||||
}
|
||||
// Otherwise, was the click in a tab
|
||||
var $clicked = $(e.target).closest( "#masthead ul.nav > li.dropdown" );
|
||||
if ( $clicked.length ) {
|
||||
$("#dd-helper").show();
|
||||
$clicked.children( ".dropdown-menu" ).show();
|
||||
e.preventDefault();
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</%def>
|
||||
|
||||
## Masthead
|
||||
|
||||
Reference in New Issue
Block a user