Difference between revisions of "Template:2016Demo bottom"

Line 11: Line 11:
 
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
 
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  
var menu_found = false;  // KNOWS IF THE MENU HAS BEEN FOUND
+
var menu_found = false;  // Does this page have a specific menu for it
 +
var what_menu_to_load;  //saves in which position of the array is the current menu that needs to be displayed
  
 
var hub_list = new Array(); //Test array  
 
var hub_list = new Array(); //Test array  
 +
 
hub_list[0]= "Safety";
 
hub_list[0]= "Safety";
 
hub_list[1]= "Judging";
 
hub_list[1]= "Judging";
Line 37: Line 39:
 
if ( wgPageName.indexOf( hub_list[i] ) > -1 ) {
 
if ( wgPageName.indexOf( hub_list[i] ) > -1 ) {
 
whichPageMenu( "https://2015.igem.org/Menu/DemoSafety" + " " + "#" +  hub_list[i] );
 
whichPageMenu( "https://2015.igem.org/Menu/DemoSafety" + " " + "#" +  hub_list[i] );
 +
what_menu_to_load = i;
 
menu_found= true;
 
menu_found= true;
 
}
 
}
Line 126: Line 129:
 
if($('#MainPage_menu').is(':visible')) {                            // if the main menu is displayed, call the hub menu that is needed  
 
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++ ) {
+
whichPageMenu( "https://2015.igem.org/Menu/DemoSafety" + " " + "#" +  hub_list[what_menu_to_load] );
 
+
if ( wgPageName.indexOf( hub_list[i] ) > -1 ) {
+
whichPageMenu( "https://2015.igem.org/Menu/DemoSafety" + " " + "#" +  hub_list[i] );
+
}
+
}
+
 
}
 
}
  

Revision as of 15:40, 24 November 2015