Elcontainer$Container.js 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130
  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.Elcontainer$Main = MWF.FCElcontainer$Main = new Class({
  4. Extends: MWF.FC$Container,
  5. Implements: [Options, Events],
  6. options: {
  7. "style": "default",
  8. "propertyPath": "../x_component_process_FormDesigner/Module/Elcontainer$Container/elcontainer$Container.html",
  9. "actions": [
  10. {
  11. "name": "selectedContainer",
  12. "icon": "select.png",
  13. "event": "click",
  14. "action": "selectedContainer",
  15. "title": MWF.APPFD.LP.formAction["selectedContainer"]
  16. }
  17. // {
  18. // "name": "delete",
  19. // "icon": "delete1.png",
  20. // "event": "click",
  21. // "action": "delete",
  22. // "title": MWF.APPFD.LP.formAction["delete"]
  23. // }
  24. ],
  25. "injectActions" : [
  26. {
  27. "name" : "top",
  28. "styles" : "injectActionTop",
  29. "event" : "click",
  30. "action" : "injectTop",
  31. "title": MWF.APPFD.LP.formAction["insertTop"]
  32. },
  33. {
  34. "name" : "bottom",
  35. "styles" : "injectActionBottom",
  36. "event" : "click",
  37. "action" : "injectBottom",
  38. "title": MWF.APPFD.LP.formAction["insertBottom"]
  39. }
  40. ]
  41. },
  42. _initModuleType: function(){
  43. this.className = "Elcontainer$Main"
  44. this.moduleType = "container";
  45. this.moduleName = "elcontainer$Main";
  46. this.cssName = "css_main";
  47. },
  48. initialize: function(form, options){
  49. this.setOptions(options);
  50. this._initModuleType();
  51. this.path = "../x_component_process_FormDesigner/Module/Elcontainer$Container/";
  52. this.cssPath = "../x_component_process_FormDesigner/Module/Elcontainer$Container/"+this.options.style+"/"+this.cssName+".wcss";
  53. this._loadCss();
  54. this._initModuleType();
  55. this.Node = null;
  56. this.form = form;
  57. },
  58. load : function(json, node, parent){
  59. this.json = json;
  60. this.node= node;
  61. this.node.store("module", this);
  62. this.node.setStyles(this.css.moduleNode);
  63. this._loadNodeStyles();
  64. this._loadNodeCustomStyles();
  65. this._initModule();
  66. this._loadTreeNode(parent);
  67. debugger;
  68. if (!this.json.id){
  69. var id = this._getNewId(((parent) ? parent.json.id : null));
  70. this.json.id = id;
  71. }
  72. if (!this.form.json.moduleList[this.json.id]){
  73. this.form.json.moduleList[this.json.id] = this.json;
  74. }
  75. this.parseModules();
  76. this.parentContainer = this.treeNode.parentNode.module;
  77. this._setEditStyle_custom("id");
  78. this.json.moduleName = this.moduleName;
  79. },
  80. _dragInLikeElement: function(module){
  81. return false;
  82. },
  83. destroy: function(){
  84. this.container.containers.erase(this);
  85. var modules = this._getSubModule();
  86. modules.each(function(module){
  87. //module._deleteModule();
  88. module.destroy();
  89. });
  90. this._deleteModule();
  91. }
  92. });
  93. MWF.xApplication.process.FormDesigner.Module.Elcontainer$Aside = MWF.FCElcontainer$Aside = new Class({
  94. Extends: MWF.FCElcontainer$Main,
  95. Implements: [Options, Events],
  96. _initModuleType: function(){
  97. this.className = "Elcontainer$Aside";
  98. this.moduleType = "container";
  99. this.moduleName = "elcontainer$Aside";
  100. this.cssName = "css_aside";
  101. }
  102. });
  103. MWF.xApplication.process.FormDesigner.Module.Elcontainer$Footer = MWF.FCElcontainer$Footer = new Class({
  104. Extends: MWF.FCElcontainer$Main,
  105. Implements: [Options, Events],
  106. _initModuleType: function(){
  107. this.className = "Elcontainer$Footer";
  108. this.moduleType = "container";
  109. this.moduleName = "elcontainer$Footer";
  110. this.cssName = "css_footer";
  111. }
  112. });
  113. MWF.xApplication.process.FormDesigner.Module.Elcontainer$Header = MWF.FCElcontainer$Header = new Class({
  114. Extends: MWF.FCElcontainer$Main,
  115. Implements: [Options, Events],
  116. _initModuleType: function(){
  117. this.className = "Elcontainer$Header";
  118. this.moduleType = "container";
  119. this.moduleName = "elcontainer$Header";
  120. this.cssName = "css_header";
  121. }
  122. });