Created
August 6, 2017 07:01
-
-
Save dimovdaniel/e7d9de7923f149c22b5fe0930d63823a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* This function finds the headers for the current menu | |
* @param firebasePath - we will use current firebasePath to find the current menu | |
*/ | |
findHeadersBasedOnPath(firebasePath){ | |
var headers=null; | |
var itemFound=false; | |
var navigation=Config.navigation; | |
for(var i=0;i<navigation.length&&!itemFound;i++){ | |
if(navigation[i].path==firebasePath&&navigation[i].tableFields){ | |
headers=navigation[i].tableFields; | |
itemFound=true; | |
} | |
//Look into the sub menus | |
if(navigation[i].subMenus){ | |
for(var j=0;j<navigation[i].subMenus.length;j++){ | |
if(navigation[i].subMenus[j].path==firebasePath&&navigation[i].subMenus[j].tableFields){ | |
headers=navigation[i].subMenus[j].tableFields; | |
itemFound=true; | |
} | |
} | |
} | |
} | |
return headers; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment