fix in customize form, fix in new record creation from listview, when no records exist
This commit is contained in:
parent
4d9953fb57
commit
532eff7d09
4 changed files with 9 additions and 13 deletions
2
js/core.min.js
vendored
2
js/core.min.js
vendored
|
|
@ -242,7 +242,7 @@ this.listview.parent=this;},init_list:function(){this.make({method:'webnotes.wid
|
|||
%(description)s\
|
||||
<hr>\
|
||||
<p><button class="btn btn-info btn-small"\
|
||||
onclick="wn.set_route(\'Form\', \'%(doctype)s\', \'New %(doctype)s\');"\
|
||||
onclick="newdoc(\'%(doctype)s\');"\
|
||||
>Make a new %(doctype_label)s</button>\
|
||||
</p></div>',{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;}
|
||||
|
|
|
|||
|
|
@ -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('<span class="label %(lab_class)s">\
|
||||
%(lab_status)s</span>', {
|
||||
lab_status: labinfo[0],
|
||||
|
|
@ -324,4 +328,4 @@ _f.FrmHeader.prototype.refresh_labels = function(f) {
|
|||
.css("background-color", "white")', 1500)
|
||||
}
|
||||
|
||||
*/
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -131,7 +131,7 @@ wn.views.DocListView = wn.ui.Listing.extend({
|
|||
%(description)s\
|
||||
<hr>\
|
||||
<p><button class="btn btn-info btn-small"\
|
||||
onclick="wn.set_route(\'Form\', \'%(doctype)s\', \'New %(doctype)s\');"\
|
||||
onclick="newdoc(\'%(doctype)s\');"\
|
||||
>Make a new %(doctype_label)s</button>\
|
||||
</p></div>', {
|
||||
doctype_label: get_doctype_label(this.doctype),
|
||||
|
|
|
|||
|
|
@ -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('<span class="label %(lab_class)s">\
|
||||
%(lab_status)s</span>', {
|
||||
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('<span class="label %(lab_class)s">\
|
||||
%(lab_status)s</span>', {
|
||||
lab_status: 'Saved',
|
||||
lab_class: 'label-success'
|
||||
}));
|
||||
cur_frm.frm_head.set_label(['Saved', 'label-success']);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue