diff --git a/js/core.min.js b/js/core.min.js index 5df10d7ec2..2aa280a80f 100644 --- a/js/core.min.js +++ b/js/core.min.js @@ -242,7 +242,7 @@ this.listview.parent=this;},init_list:function(){this.make({method:'webnotes.wid %(description)s\
\
',{doctype_label:get_doctype_label(this.doctype),doctype:this.doctype,description:wn.markdown(locals.DocType[this.doctype].description||'')});},render_row:function(row,data){data.doctype=this.doctype;this.listview.render(row,data,this);},get_query_fields:function(){return this.listview.fields;},get_args:function(){return{doctype:this.doctype,fields:this.get_query_fields(),filters:this.filter_list.get_filters(),docstatus:this.can_submit?$.map(this.$page.find('.show-docstatus :checked'),function(inp){return $(inp).attr('data-docstatus')}):[]}},add_delete_option:function(){var me=this;if(this.can_delete){this.add_button('Delete',function(){me.delete_items();},'icon-remove')}},delete_items:function(){var me=this;var dl=$.map(me.$page.find('.list-delete:checked'),function(e){return $(e).data('name');});if(!dl.length) return;if(!confirm('This is PERMANENT action and you cannot undo. Continue?')){return;} diff --git a/js/legacy/widgets/form/form_header.js b/js/legacy/widgets/form/form_header.js index ca9bd579ea..68f5d7f11b 100644 --- a/js/legacy/widgets/form/form_header.js +++ b/js/legacy/widgets/form/form_header.js @@ -54,7 +54,11 @@ _f.FrmHeader = Class.extend({ if(cur_frm.doc.__unsaved) { labinfo[1] = 'label-warning' } + + this.set_label(labinfo); + }, + set_label: function(labinfo) { this.$w.find('.label-area').html(repl('\ %(lab_status)s', { lab_status: labinfo[0], @@ -324,4 +328,4 @@ _f.FrmHeader.prototype.refresh_labels = function(f) { .css("background-color", "white")', 1500) } -*/ \ No newline at end of file +*/ diff --git a/js/wn/views/doclistview.js b/js/wn/views/doclistview.js index 0d98a9b5b5..8efeb0bc09 100644 --- a/js/wn/views/doclistview.js +++ b/js/wn/views/doclistview.js @@ -131,7 +131,7 @@ wn.views.DocListView = wn.ui.Listing.extend({ %(description)s\\
', { doctype_label: get_doctype_label(this.doctype), diff --git a/py/core/doctype/customize_form/customize_form.js b/py/core/doctype/customize_form/customize_form.js index a833e15fb2..2c48a877fe 100644 --- a/py/core/doctype/customize_form/customize_form.js +++ b/py/core/doctype/customize_form/customize_form.js @@ -45,11 +45,7 @@ cur_frm.cscript.refresh = function(doc, dt, dn) { msgprint(r.exc); } else { if(r.server_messages) { cur_frm.cscript.doc_type(doc, doc.doctype, doc.name); } - cur_frm.frm_head.$w.find('.label-area').html(repl('\ - %(lab_status)s', { - lab_status: 'Saved', - lab_class: 'label-success' - })); + cur_frm.frm_head.set_label(['Saved', 'label-success']); } }); } @@ -116,11 +112,7 @@ cur_frm.confirm = function(msg, doc, dt, dn) { } else { cur_frm.confirm.dialog.hide(); cur_frm.refresh(); - cur_frm.frm_head.$w.find('.label-area').html(repl('\ - %(lab_status)s', { - lab_status: 'Saved', - lab_class: 'label-success' - })); + cur_frm.frm_head.set_label(['Saved', 'label-success']); } }); });