Tab$Content.js 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  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. },
  11. initialize: function(tab, page, options){
  12. this.setOptions(options);
  13. this.path = "/x_component_process_FormDesigner/Module/Tab$Content/";
  14. this.cssPath = "/x_component_process_FormDesigner/Module/Tab$Content/"+this.options.style+"/css.wcss";
  15. this._loadCss();
  16. this.moduleType = "container";
  17. this.moduleName = "tab$Content";
  18. this.form = tab.form;
  19. this.tab = tab;
  20. this.page = page;
  21. },
  22. _dragInLikeElement: function(module){
  23. return false;
  24. },
  25. load : function(json, node, parent){
  26. this.json = json;
  27. this.node= node;
  28. this.node.store("module", this);
  29. this.node.setStyles(this.css.moduleNode);
  30. if (!this.json.id){
  31. var id = this._getNewId(parent.json.id);
  32. this.json.id = id;
  33. }
  34. node.set({
  35. "MWFType": "tab$Content",
  36. "id": this.json.id
  37. });
  38. if (!this.form.json.moduleList[this.json.id]){
  39. this.form.json.moduleList[this.json.id] = this.json;
  40. }
  41. this._initModule();
  42. this._loadTreeNode(parent);
  43. this.setCustomStyles();
  44. this.parentContainer = this.treeNode.parentNode.module;
  45. this._setEditStyle_custom("id");
  46. this.parseModules();
  47. this.json.moduleName = this.moduleName;
  48. },
  49. _deleteModule: function(){
  50. this.form.moduleList.erase(this);
  51. this.form.moduleNodeList.erase(this.node);
  52. this.form.moduleElementNodeList.erase(this.node);
  53. //this.tab.containers.erase(this);
  54. this.node.destroy();
  55. this.actionArea.destroy();
  56. delete this.form.json.moduleList[this.json.id];
  57. this.json = null;
  58. delete this.json;
  59. this.treeNode.destroy();
  60. }
  61. });