Difference between revisions of "Template:2016Demo bottom"

Line 29: Line 29:
 
$(document).ready(function() {
 
$(document).ready(function() {
  
if ( wgPageName.indexOf( hub_list[0] ) > -1 ) {
+
showMainMenu();
+
//Check if it is the main page and displays main menu if so
menu_found= true;
+
}
+
if ( wgPageName.indexOf( hub_list[0] ) > -1 ) {
 +
showMainMenu();
 +
menu_found= true;
 +
}
  
for ( var i=1; i< hub_list.length; i++ ) {
+
// if it is not the main page check if there is a hub menu for it
 +
else if (menu_found == false) {
 +
for ( var i=1; i< hub_list.length; i++ ) {
  
if ( wgPageName.indexOf( hub_list[i] ) > -1 ){
+
if ( wgPageName.indexOf( hub_list[i] ) > -1 ) {
whichPageMenu( hub_list[i] );
+
whichPageMenu( hub_list[i] );
menu_found= true;
+
menu_found= true;
 +
}
 
}
 
}
 
}
 
}
  
 +
 +
// finally - if it doesn't have a hub menu, displays the main menu as default
 
if (menu_found == false ) {
 
if (menu_found == false ) {
 
showMainMenu();
 
showMainMenu();

Revision as of 20:07, 23 November 2015