top bar to accept url

This commit is contained in:
Rushabh Mehta
2012-02-07 10:39:17 +05:30
parent 0a45f96c48
commit f35992f695
3 changed files with 32 additions and 33 deletions

View File

@@ -37,7 +37,7 @@ erpnext.topbar.TopBar = Class.extend({
for(var i=0;i<items.length;i++) {
var item = items[i];
if(!item.parent_label && item.parentfield=='top_bar_items') {
item.route = item.custom_page ? item.custom_page : item.std_page.toLowerCase();
item.route = item.url || item.custom_page;
$('header .nav:first').append(repl('<li><a href="#!%(route)s" \
data-label="%(label)s">%(label)s</a></li>', item))
}
@@ -64,7 +64,7 @@ erpnext.Footer = Class.extend({
for(var i=0;i<items.length;i++) {
var item = items[i];
if(!item.parent_label && item.parentfield=='footer_items') {
item.route = item.custom_page ? item.custom_page : item.std_page.toLowerCase();
item.route = item.url || item.custom_page;
$('.web-footer-menu ul').append(repl('<li><a href="#!%(route)s" \
data-label="%(label)s">%(label)s</a></li>', item))
}