Tab$Content.js 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. MWF.xApplication.cms.FormDesigner.Module = MWF.xApplication.cms.FormDesigner.Module || {};
  2. MWF.xDesktop.requireApp("cms.FormDesigner", "Module.$Container", null, false);
  3. MWF.xApplication.cms.FormDesigner.Module.Tab$Content = MWF.CMSFCTab$Content = new Class({
  4. Extends: MWF.CMSFC$Container,
  5. Implements: [Options, Events],
  6. options: {
  7. "style": "default",
  8. "propertyPath": "/x_component_cms_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_cms_FormDesigner/Module/Tab$Content/";
  14. this.cssPath = "/x_component_cms_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. },
  48. _deleteModule: function(){
  49. this.form.moduleList.erase(this);
  50. this.form.moduleNodeList.erase(this.node);
  51. this.form.moduleElementNodeList.erase(this.node);
  52. //this.tab.containers.erase(this);
  53. this.node.destroy();
  54. this.actionArea.destroy();
  55. delete this.form.json.moduleList[this.json.id];
  56. this.json = null;
  57. delete this.json;
  58. this.treeNode.destroy();
  59. }
  60. });