浏览代码

[minor] run script manager after making object

version-14
Anand Doshi 12 年前
父节点
当前提交
0930c52fc1
共有 2 个文件被更改,包括 5 次插入2 次删除
  1. +2
    -1
      public/js/legacy/widgets/form/form.js
  2. +3
    -1
      public/js/wn/form/script_manager.js

+ 2
- 1
public/js/legacy/widgets/form/form.js 查看文件

@@ -129,7 +129,8 @@ _f.Frm.prototype.setup = function() {
// client script must be called after "setup" - there are no fields_dict attached to the frm otherwise // client script must be called after "setup" - there are no fields_dict attached to the frm otherwise
this.script_manager = new wn.ui.form.ScriptManager({ this.script_manager = new wn.ui.form.ScriptManager({
frm: this frm: this
})
});
this.script_manager.setup();
this.watch_model_updates(); this.watch_model_updates();
this.footer = new wn.ui.form.Footer({ this.footer = new wn.ui.form.Footer({


+ 3
- 1
public/js/wn/form/script_manager.js 查看文件

@@ -1,7 +1,9 @@
wn.ui.form.ScriptManager = Class.extend({ wn.ui.form.ScriptManager = Class.extend({
init: function(opts) { init: function(opts) {
$.extend(this, opts); $.extend(this, opts);
this.setup();
},
make: function(ControllerClass) {
this.frm.cscript = $.extend(this.frm.cscript, new ControllerClass({frm: this.frm}));
}, },
trigger: function(event_name, doctype, name) { trigger: function(event_name, doctype, name) {
doctype = doctype || this.frm.doctype; doctype = doctype || this.frm.doctype;


正在加载...
取消
保存