Ver a proveniência

[hot] more js fixes

version-14
Rushabh Mehta há 8 anos
ascendente
cometimento
4a7551a010
2 ficheiros alterados com 14 adições e 4 eliminações
  1. +1
    -1
      frappe/public/js/frappe/form/control.js
  2. +13
    -3
      frappe/public/js/frappe/form/script_manager.js

+ 1
- 1
frappe/public/js/frappe/form/control.js Ver ficheiro

@@ -129,7 +129,7 @@ frappe.ui.form.Control = Class.extend({
};

value = this.validate(value);
if (value.then) {
if (value && value.then) {
// got a promise
return value.then((value) => set(value));
} else {


+ 13
- 3
frappe/public/js/frappe/form/script_manager.js Ver ficheiro

@@ -101,11 +101,21 @@ frappe.ui.form.ScriptManager = Class.extend({

// make list of functions to be run serially
handlers.new_style.forEach((_function) => {
tasks.push(() => runner(_function, false));
if(event_name==='setup') {
// setup must be called immediately
runner(_function, false);
} else {
tasks.push(() => runner(_function, false));
}
});

handlers.old_style.forEach((_function) => {
tasks.push(() => runner(_function, true));
if(event_name==='setup') {
// setup must be called immediately
runner(_function, false);
} else {
tasks.push(() => runner(_function, true));
}
});

// run them serially
@@ -147,7 +157,7 @@ frappe.ui.form.ScriptManager = Class.extend({

if(doctype.__custom_js) {
try {
eval(doctype.__custom_js)
eval(doctype.__custom_js);
} catch(e) {
frappe.msgprint({
title: __('Error in Custom Script'),


Carregando…
Cancelar
Guardar