|
|
|
@ -246,10 +246,13 @@ onLoad(function() { |
|
|
|
|
// populate menu via ajax call
|
|
|
|
|
var getMenu = function() { |
|
|
|
|
ajaxJson("GET", "/menu", function(data) { |
|
|
|
|
var html = ""; |
|
|
|
|
var html = "", path = window.location.pathname; |
|
|
|
|
for (var i=0; i<data.menu.length; i+=2) { |
|
|
|
|
html = html.concat(" <li class=\"pure-menu-item\"><a href=\"" + data.menu[i+1] + |
|
|
|
|
"\" class=\"pure-menu-link\">" + data.menu[i] + "</a></li>"); |
|
|
|
|
var href = data.menu[i+1]; |
|
|
|
|
html = html.concat(" <li class=\"pure-menu-item" + |
|
|
|
|
(path === href ? " pure-menu-selected" : "") + "\">" + |
|
|
|
|
"<a href=\"" + href + "\" class=\"pure-menu-link\">" + |
|
|
|
|
data.menu[i] + "</a></li>"); |
|
|
|
|
} |
|
|
|
|
$("#menu-list").innerHTML = html; |
|
|
|
|
|
|
|
|
|