Difference between revisions of "Template:2016Demo bottom"
Line 14: | Line 14: | ||
var hub_list = new Array(); //Test array | var hub_list = new Array(); //Test array | ||
− | hub_list[0]= " | + | hub_list[0]= "Safety"; |
− | hub_list[1]= " | + | hub_list[1]= "Judging"; |
− | hub_list[2]= " | + | hub_list[2]= "informationpage"; |
− | hub_list[3 | + | hub_list[3]= "Code"; |
− | + | ||
Line 27: | Line 26: | ||
//Check if it is the main page and displays main menu if so | //Check if it is the main page and displays main menu if so | ||
− | if ( wgPageName.indexOf( | + | if ( wgPageName.indexOf("main_page" ) > -1 ) { |
showMainMenu(); | showMainMenu(); | ||
menu_found= true; | menu_found= true; | ||
Line 34: | Line 33: | ||
// if it is not the main page check if there is a hub menu for it | // if it is not the main page check if there is a hub menu for it | ||
else if (menu_found == false) { | else if (menu_found == false) { | ||
− | for ( var i= | + | for ( var i=0; i< hub_list.length; i++ ) { |
if ( wgPageName.indexOf( hub_list[i] ) > -1 ) { | if ( wgPageName.indexOf( hub_list[i] ) > -1 ) { | ||
Line 79: | Line 78: | ||
function showMainMenu() { | function showMainMenu() { | ||
− | $( "#menuDisplay" ).load( "https://2015.igem.org/Menu/DemoSafety # | + | $( "#menuDisplay" ).load( "https://2015.igem.org/Menu/DemoSafety #MainPage_menu", function() { // ALL OTHER CASES SHOWS MAIN MENU |
activateLoadedMenu(); | activateLoadedMenu(); | ||
Line 125: | Line 124: | ||
− | if($('# | + | if($('#MainPage_menu').is(':visible')) { // if the main menu is displayed, call the hub menu that is needed |
for ( var i=1; i< hub_list.length; i++ ) { | for ( var i=1; i< hub_list.length; i++ ) { | ||
Line 139: | Line 138: | ||
$(".switch_Menus").html(" ▶ "); | $(".switch_Menus").html(" ▶ "); | ||
− | $( "#menuDisplay" ).load( "https://2015.igem.org/Menu/DemoSafety # | + | $( "#menuDisplay" ).load( "https://2015.igem.org/Menu/DemoSafety #MainPage_menu", function() { |
activateLoadedMenu(); | activateLoadedMenu(); | ||
} ); | } ); |
Revision as of 22:20, 23 November 2015