Browse Source

[minor] run script manager after making object

version-14
Anand Doshi 12 years ago
parent
commit
0930c52fc1
2 changed files with 5 additions and 2 deletions
  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 View File

@@ -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
this.script_manager = new wn.ui.form.ScriptManager({
frm: this
})
});
this.script_manager.setup();
this.watch_model_updates();
this.footer = new wn.ui.form.Footer({


+ 3
- 1
public/js/wn/form/script_manager.js View File

@@ -1,7 +1,9 @@
wn.ui.form.ScriptManager = Class.extend({
init: function(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) {
doctype = doctype || this.frm.doctype;


Loading…
Cancel
Save