From 964f850a42310a0f37faeeb925789dec89cccd33 Mon Sep 17 00:00:00 2001 From: Rushabh Mehta Date: Fri, 15 Nov 2013 13:52:10 +0530 Subject: [PATCH] [ui] changes to toolbar and no back button for singles webnotes/erpnext#1052 --- public/css/common.css | 14 ++------------ public/js/wn/form/toolbar.js | 10 ++++++++-- public/js/wn/ui/appframe.js | 1 + 3 files changed, 11 insertions(+), 14 deletions(-) diff --git a/public/css/common.css b/public/css/common.css index d45a1377f2..ec4514442d 100644 --- a/public/css/common.css +++ b/public/css/common.css @@ -161,7 +161,6 @@ div#freeze { /* appframe header */ .appframe { - overflow: hidden; padding-top: 15px; } @@ -223,7 +222,7 @@ div#freeze { } .appframe-iconbar, .appframe-form { - border-bottom: 2px solid #c7c7c7; + border-bottom: 1px solid #c7c7c7; } .appframe-form { @@ -246,12 +245,7 @@ div#freeze { .iconbar { display: inline-block; - padding: 9px; - border-right: 1px solid #c7c7c7; -} - -.iconbar:last-child { - border-right: 0px; + padding: 9px 0px; } .iconbar ul { @@ -266,10 +260,6 @@ div#freeze { padding-right: 4px; } -.iconbar li:last-child { - padding-right: 0px; -} - .iconbar i { margin-top: 4px; margin-right: 4px; diff --git a/public/js/wn/form/toolbar.js b/public/js/wn/form/toolbar.js index 0305d110bc..fba567eb00 100644 --- a/public/js/wn/form/toolbar.js +++ b/public/js/wn/form/toolbar.js @@ -40,8 +40,14 @@ wn.ui.form.Toolbar = Class.extend({ var me = this; this.appframe.set_title(title + this.get_lock_status(), wn._(this.frm.docname), this.frm.doc.modified_by); - this.appframe.set_title_left(' ' + wn._(this.frm.doctype), - function() { wn.set_route("List", me.frm.doctype); }); + + if(this.frm.meta.issingle) { + this.appframe.set_title_left(' ' + wn._(this.frm.meta.module), + function() { wn.set_route(wn.modules[me.frm.meta.module].link); }); + } else { + this.appframe.set_title_left(' ' + wn._(this.frm.doctype), + function() { wn.set_route("List", me.frm.doctype); }); + } }, show_infobar: function() { /* docs: diff --git a/public/js/wn/ui/appframe.js b/public/js/wn/ui/appframe.js index a3c65ca5b8..872e20e25b 100644 --- a/public/js/wn/ui/appframe.js +++ b/public/js/wn/ui/appframe.js @@ -26,6 +26,7 @@ wn.ui.AppFrame = Class.extend({ setup_iconbar: function() { var me = this; this.iconbar = new wn.ui.IconBar(this.parent.find(".appframe-iconbar .container"), 3); + this.iconbar.$wrapper.find(".iconbar-3").addClass("pull-right"); this.iconbar.$wrapper.on("shown", function() { me.parent.find(".appframe-iconbar").removeClass("hide")