From 3cddbbacbcae7b5b45af6c1f9fde6da738779de0 Mon Sep 17 00:00:00 2001 From: Rushabh Mehta Date: Mon, 31 Dec 2012 10:51:31 +0530 Subject: [PATCH] updated usability of payment_to_invoice_matching tool and fixed hide_toolbar --- public/js/legacy/widgets/form/form.js | 12 +++++++----- public/js/legacy/widgets/form/form_header.js | 2 ++ public/js/wn/form/states.js | 10 +++++----- 3 files changed, 14 insertions(+), 10 deletions(-) diff --git a/public/js/legacy/widgets/form/form.js b/public/js/legacy/widgets/form/form.js index 167669ca79..61c0ef20ff 100644 --- a/public/js/legacy/widgets/form/form.js +++ b/public/js/legacy/widgets/form/form.js @@ -191,10 +191,12 @@ _f.Frm.prototype.setup_std_layout = function() { }); // watermark - $('
' - + this.doctype + '
') - .prependTo(this.page_layout.main); + if(!this.meta.issingle) { + $('
' + + this.doctype + '
') + .prependTo(this.page_layout.main); + } // footer this.setup_footer(); @@ -604,7 +606,7 @@ _f.Frm.prototype.refresh = function(docname) { _f.Frm.prototype.refresh_footer = function() { var f = this.page_layout.footer; if(f.save_area) { - if(this.editable && (!this.meta.in_dialog || this.in_form) + if(this.editable && (!this.meta.hide_toolbar) && (!this.meta.in_dialog || this.in_form) && this.doc.docstatus==0 && !this.meta.istable && this.perm[0][WRITE] && (this.fields && this.fields.length > 7) && !this.save_disabled) { f.show_save(); diff --git a/public/js/legacy/widgets/form/form_header.js b/public/js/legacy/widgets/form/form_header.js index 6bb967749a..fd8c7b7e6a 100644 --- a/public/js/legacy/widgets/form/form_header.js +++ b/public/js/legacy/widgets/form/form_header.js @@ -112,6 +112,7 @@ _f.FrmHeader = Class.extend({ }, set_label: function(labinfo) { this.$w.find('.label').remove(); + if(cur_frm.meta.hide_toolbar) return; $(repl('\ %(lab_status)s', { lab_status: labinfo[0], @@ -123,6 +124,7 @@ _f.FrmHeader = Class.extend({ if(cur_frm.meta.hide_toolbar) { $('.appframe-toolbar').toggle(false); + cur_frm.save_disabled = true; return; } diff --git a/public/js/wn/form/states.js b/public/js/wn/form/states.js index 413403aa02..e822c9e4d2 100644 --- a/public/js/wn/form/states.js +++ b/public/js/wn/form/states.js @@ -42,16 +42,16 @@ wn.ui.form.States = Class.extend({ \ \ ').appendTo(this.frm.page_layout.body_header); + this.$wrapper.toggle(false); }, refresh: function() { // hide if its not yet saved + this.$wrapper.toggle(false); if(this.frm.doc.__islocal) { this.set_default_state(); - this.$wrapper.toggle(false); return; } - this.$wrapper.toggle(true); // state text var state = this.get_state(); @@ -76,9 +76,9 @@ wn.ui.form.States = Class.extend({ this.show_actions(state); // disable if not allowed - } else { - this.$wrapper.toggle(false); - } + if(!this.frm.doc.__islocal) + this.$wrapper.toggle(true); + } }, show_actions: function(state) {