Elcontainer$Container.js 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129
  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. if (!this.json.id){
  68. var id = this._getNewId(((parent) ? parent.json.id : null));
  69. this.json.id = id;
  70. }
  71. if (!this.form.json.moduleList[this.json.id]){
  72. this.form.json.moduleList[this.json.id] = this.json;
  73. }
  74. this.parseModules();
  75. this.parentContainer = this.treeNode.parentNode.module;
  76. this._setEditStyle_custom("id");
  77. this.json.moduleName = this.moduleName;
  78. },
  79. _dragInLikeElement: function(module){
  80. return false;
  81. },
  82. destroy: function(){
  83. this.container.containers.erase(this);
  84. var modules = this._getSubModule();
  85. modules.each(function(module){
  86. //module._deleteModule();
  87. module.destroy();
  88. });
  89. this._deleteModule();
  90. }
  91. });
  92. MWF.xApplication.process.FormDesigner.Module.Elcontainer$Aside = MWF.FCElcontainer$Aside = new Class({
  93. Extends: MWF.FCElcontainer$Main,
  94. Implements: [Options, Events],
  95. _initModuleType: function(){
  96. this.className = "Elcontainer$Aside";
  97. this.moduleType = "container";
  98. this.moduleName = "elcontainer$Aside";
  99. this.cssName = "css_aside";
  100. }
  101. });
  102. MWF.xApplication.process.FormDesigner.Module.Elcontainer$Footer = MWF.FCElcontainer$Footer = new Class({
  103. Extends: MWF.FCElcontainer$Main,
  104. Implements: [Options, Events],
  105. _initModuleType: function(){
  106. this.className = "Elcontainer$Footer";
  107. this.moduleType = "container";
  108. this.moduleName = "elcontainer$Footer";
  109. this.cssName = "css_footer";
  110. }
  111. });
  112. MWF.xApplication.process.FormDesigner.Module.Elcontainer$Header = MWF.FCElcontainer$Header = new Class({
  113. Extends: MWF.FCElcontainer$Main,
  114. Implements: [Options, Events],
  115. _initModuleType: function(){
  116. this.className = "Elcontainer$Header";
  117. this.moduleType = "container";
  118. this.moduleName = "elcontainer$Header";
  119. this.cssName = "css_header";
  120. }
  121. });