diff options
Diffstat (limited to 'themes/default/js/menu.js')
-rw-r--r-- | themes/default/js/menu.js | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/themes/default/js/menu.js b/themes/default/js/menu.js index eb6b5bb..8617d42 100644 --- a/themes/default/js/menu.js +++ b/themes/default/js/menu.js @@ -11,12 +11,16 @@ function main_menu(items) { } // Line break labels - label = i["label"]; + /*label = i["label"]; if (label.search(" ") != -1) { label = label.replace(" ", "<br />"); } else { label = " <br />" + label; - } + }*/ + + // Add icon before labels + icon = '<i class="' + i["icon"] + ' icon-white nav-icon"></i>'; + label = icon + i["label"]; output = output +'<li' + active + '><a href="' + i["url"] + '"' + active + '>' + label + "</a></li>"; } @@ -32,11 +36,20 @@ function render_items(items) { // Handle active page if (i["active"]) { active = ' class="active"'; + + // Add icon before labels + icon = '<i class="' + i["icon"] + ' icon-white sidenav-icon"></i>'; + label = icon + i["label"]; } else { active = ''; + + // Add icon before labels + icon = '<i class="' + i["icon"] + ' sidenav-icon"></i>'; + label = icon + i["label"]; } - output = output +'<li' + active + '><a href="' + i["url"] + '"' + active + '>' + i['label'] + "</a></li>"; + output = output +'<li' + active + '><a href="' + i["url"] + '"' + active + '>' + label + "</a></li>"; + if (i['subs']) { output += render_items(i['subs']); } |