Просмотр исходного кода

fix: Use extend_cscript in make to properly extend functions of class

version-14
Suraj Shetty 4 лет назад
Родитель
Сommit
4410813502
2 измененных файлов: 4 добавлений и 2 удалений
  1. +2
    -1
      .eslintrc
  2. +2
    -1
      frappe/public/js/frappe/form/script_manager.js

+ 2
- 1
.eslintrc Просмотреть файл

@@ -149,6 +149,7 @@
"before": true,
"beforeEach": true,
"qz": true,
"localforage": true
"localforage": true,
"extend_cscript": true
}
}

+ 2
- 1
frappe/public/js/frappe/form/script_manager.js Просмотреть файл

@@ -8,6 +8,7 @@ window.extend_cscript = (cscript, controller_object) => {
if (cscript && controller_object) {
cscript.__proto__ = controller_object.__proto__;
}
return cscript;
};

frappe.ui.form.get_event_handler_list = function(doctype, fieldname) {
@@ -81,7 +82,7 @@ frappe.ui.form.ScriptManager = class ScriptManager {
$.extend(this, opts);
}
make(ControllerClass) {
this.frm.cscript = $.extend(this.frm.cscript,
this.frm.cscript = extend_cscript(this.frm.cscript,
new ControllerClass({frm: this.frm}));
}
trigger(event_name, doctype, name) {


Загрузка…
Отмена
Сохранить