Selaa lähdekoodia

[fix] document_flow.js

version-14
Rushabh Mehta 9 vuotta sitten
vanhempi
commit
4347fac6a1
1 muutettua tiedostoa jossa 15 lisäystä ja 11 poistoa
  1. +15
    -11
      frappe/public/js/frappe/form/document_flow.js

+ 15
- 11
frappe/public/js/frappe/form/document_flow.js Näytä tiedosto

@@ -4,12 +4,24 @@
frappe.ui.form.DocumentFlow = Class.extend({
init: function(opts) {
$.extend(this, opts);

this.module = frappe.get_meta(this.frm.doctype).module
if (!frappe.document_flow[this.module]) {
return;
}
this.doctypes = frappe.document_flow[this.module][this.frm.doctype];
if (!this.doctypes) {
return;
}

this.wrapper = $('<div class="document-flow-wrapper hidden"></div>').prependTo(this.frm.layout.wrapper);
},

refresh: function() {
this.reset();
this.render();
if(this.doctypes) {
this.reset();
this.render();
}
},

reset: function() {
@@ -19,18 +31,10 @@ frappe.ui.form.DocumentFlow = Class.extend({

render: function() {
var me = this;
var module = frappe.get_meta(this.frm.doctype).module
if (!frappe.document_flow[module]) {
return;
}
var doctypes = frappe.document_flow[module][this.frm.doctype];
if (!doctypes) {
return;
}

$(frappe.render_template('form_document_flow', {
frm: this.frm,
doctypes: doctypes,
doctypes: this.doctypes,
})).appendTo(this.wrapper.removeClass('hidden'));

this.wrapper.on('click', '.document-flow-link', function() {


Ladataan…
Peruuta
Tallenna