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