Tab$Content.js 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. MWF.xApplication.process.FormDesigner.Module = MWF.xApplication.process.FormDesigner.Module || {};
  2. MWF.xDesktop.requireApp("process.FormDesigner", "Module.$Container", null, false);
  3. MWF.xApplication.process.FormDesigner.Module.Tab$Content = MWF.FCTab$Content = new Class({
  4. Extends: MWF.FC$Container,
  5. Implements: [Options, Events],
  6. options: {
  7. "style": "default",
  8. "propertyPath": "../x_component_process_FormDesigner/Module/Tab$Content/tab$Content.html",
  9. "actions": [],
  10. "injectActions" : [
  11. {
  12. "name" : "top",
  13. "styles" : "injectActionTop",
  14. "event" : "click",
  15. "action" : "injectTop",
  16. "title": MWF.APPFD.LP.formAction["insertTop"]
  17. },
  18. {
  19. "name" : "bottom",
  20. "styles" : "injectActionBottom",
  21. "event" : "click",
  22. "action" : "injectBottom",
  23. "title": MWF.APPFD.LP.formAction["insertBottom"]
  24. }
  25. ]
  26. },
  27. initialize: function(tab, page, options){
  28. this.setOptions(options);
  29. this.path = "../x_component_process_FormDesigner/Module/Tab$Content/";
  30. this.cssPath = "../x_component_process_FormDesigner/Module/Tab$Content/"+this.options.style+"/css.wcss";
  31. this._loadCss();
  32. this.moduleType = "container";
  33. this.moduleName = "tab$Content";
  34. this.form = tab.form;
  35. this.tab = tab;
  36. this.page = page;
  37. },
  38. _dragInLikeElement: function(module){
  39. return false;
  40. },
  41. load : function(json, node, parent){
  42. this.json = json;
  43. this.node= node;
  44. this.node.store("module", this);
  45. this.node.setStyles(this.css.moduleNode);
  46. if (!this.json.id){
  47. var id = this._getNewId(parent.json.id);
  48. this.json.id = id;
  49. }
  50. node.set({
  51. "MWFType": "tab$Content",
  52. "id": this.json.id
  53. });
  54. if (!this.form.json.moduleList[this.json.id]){
  55. this.form.json.moduleList[this.json.id] = this.json;
  56. }
  57. this._initModule();
  58. this._loadTreeNode(parent);
  59. this.setCustomStyles();
  60. this.parentContainer = this.treeNode.parentNode.module;
  61. this._setEditStyle_custom("id");
  62. this.parseModules();
  63. this.json.moduleName = this.moduleName;
  64. },
  65. _deleteModule: function(){
  66. this.form.moduleList.erase(this);
  67. this.form.moduleNodeList.erase(this.node);
  68. this.form.moduleElementNodeList.erase(this.node);
  69. //this.tab.containers.erase(this);
  70. this.node.destroy();
  71. this.actionArea.destroy();
  72. delete this.form.json.moduleList[this.json.id];
  73. this.json = null;
  74. delete this.json;
  75. this.treeNode.destroy();
  76. }
  77. });