on changing value of a form's field, do not call refresh toolbar, as it clears all custom buttons
This commit is contained in:
parent
f57f5bcff2
commit
9ccbb29dc2
2 changed files with 11 additions and 4 deletions
|
|
@ -1113,10 +1113,12 @@ _f.set_value = function(dt, dn, fn, v) {
|
|||
d.__unsaved = 1;
|
||||
|
||||
if(d.parent && d.parenttype) {
|
||||
locals[d.parenttype][d.parent].__unsaved = 1;
|
||||
var doc = locals[d.parenttype][d.parent];
|
||||
doc.__unsaved = 1;
|
||||
var frm = wn.views.formview[d.parenttype].frm;
|
||||
} else {
|
||||
locals[d.doctype][d.name].__unsaved = 1;
|
||||
var doc = locals[d.doctype][d.name]
|
||||
doc.__unsaved = 1;
|
||||
var frm = wn.views.formview[d.doctype] && wn.views.formview[d.doctype].frm;
|
||||
}
|
||||
|
||||
|
|
@ -1124,7 +1126,7 @@ _f.set_value = function(dt, dn, fn, v) {
|
|||
// Just check if __unsaved was not set previously
|
||||
if(frm && frm==cur_frm && frm.frm_head && !prev_unsaved) {
|
||||
frm.frm_head.refresh_labels();
|
||||
frm.frm_head.refresh_toolbar();
|
||||
//frm.frm_head.refresh_toolbar();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -62,13 +62,18 @@ _f.FrmHeader = Class.extend({
|
|||
|
||||
this.set_label(labinfo);
|
||||
|
||||
// show update button if unsaved
|
||||
if(cur_frm.doc.__unsaved && cint(cur_frm.doc.docstatus)==1 && this.appframe.buttons['Update']) {
|
||||
this.appframe.buttons['Update'].toggle(true);
|
||||
}
|
||||
|
||||
},
|
||||
set_label: function(labinfo) {
|
||||
this.$w.find('.label-area').html(repl('<span class="label %(lab_class)s">\
|
||||
%(lab_status)s</span>', {
|
||||
lab_status: labinfo[0],
|
||||
lab_class: labinfo[1]
|
||||
}));
|
||||
}));
|
||||
},
|
||||
refresh_toolbar: function() {
|
||||
// clear
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue