Ver código fonte

[minor] run script manager after making object

version-14
Anand Doshi 12 anos atrás
pai
commit
0930c52fc1
2 arquivos alterados com 5 adições e 2 exclusões
  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 Ver arquivo

@@ -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 Ver arquivo

@@ -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;


Carregando…
Cancelar
Salvar