MainInContainer.js 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  1. //用法,z在 cms / 流程表单 / 门户中插入
  2. //MWF.xApplication.ForumSection = MWF.xApplication.ForumSection || {};
  3. //MWF.xApplication.ForumSection.options = MWF.xApplication.ForumSection.options || {};
  4. //MWF.xDesktop.requireApp("ForumSection", "MainInContainer", null, false);
  5. //MWF.xApplication.ForumSection.MainInContainer2 = new Class({
  6. // Extends: MWF.xApplication.ForumSection.MainInContainer,
  7. // loadLayout: function(){
  8. // this.contentNode = new Element("div", {"styles": this.css.contentNode}).inject(this.node);
  9. // this.toWeek();
  10. // }
  11. //});
  12. //var container = this.form.get("container").node;
  13. //var scrollNode = this.target.app.node;
  14. //var forumsection = new MWF.xApplication.ForumSection.MainInContainer2( this.target.app.desktop, {}, container, this.target.app.content , scrollNode );
  15. //forumsection.load();
  16. MWF.xApplication.ForumSection = MWF.xApplication.ForumSection || {};
  17. MWF.xApplication.ForumSection.options = MWF.xApplication.ForumSection.options || {};
  18. MWF.xDesktop.requireApp("ForumSection", "lp."+MWF.language, null, false);
  19. MWF.xDesktop.requireApp("ForumSection", "Main", null, false) ;
  20. MWF.xApplication.ForumSection.MainInContainer = new Class({
  21. Extends: MWF.xApplication.ForumSection.Main,
  22. Implements: [Options, Events],
  23. options: {
  24. "style": "default",
  25. "name": "ForumSection",
  26. "naviMode" : false
  27. },
  28. initialize: function(desktop, options, container, content, scrollNode){
  29. this.setOptions(options);
  30. this.desktop = desktop;
  31. this.container = container;
  32. this.content = content;
  33. this.scrollNode = scrollNode;
  34. this.path = "../x_component_"+this.options.name.replace(/\./g, "_")+"/$Main/";
  35. this.options.icon = this.path+this.options.style+"/"+this.options.icon;
  36. this.cssPath =this.path+this.options.style+"/css.wcss";
  37. this.naviMode = this.options.naviMode;
  38. //this.inBrowser = true;
  39. this.inContainer = true;
  40. this._loadCss();
  41. },
  42. loadNoAnimation: function(isCurrent, max, hide){
  43. this.fireAppEvent("queryLoad");
  44. if (!this.inContainer){
  45. this.loadWindow(isCurrent, false, max, hide);
  46. }else{
  47. this.loadInBrowser(isCurrent);
  48. }
  49. },
  50. load : function(isCurrent){
  51. this.fireAppEvent("queryLoad");
  52. if (!this.inContainer){
  53. this.loadWindow(isCurrent);
  54. }else{
  55. this.loadInBrowser(isCurrent);
  56. }
  57. },
  58. close: function(){
  59. this.fireAppEvent("queryClose");
  60. this.setUncurrent();
  61. if (this.inBrowser){
  62. window.close();
  63. }else{
  64. this.window.close(function(){
  65. this.taskitem.destroy();
  66. delete this.window;
  67. delete this.taskitem;
  68. this.desktop.closeApp(this);
  69. this.fireAppEvent("postClose");
  70. //MWF.recycleCount = 0;
  71. //debugger;
  72. MWF.release(this);
  73. //
  74. //alert(MWF.recycleCount)
  75. //debugger;
  76. }.bind(this));
  77. }
  78. },
  79. loadInBrowser: function(){
  80. this.window = {
  81. "isHide": false,
  82. "isMax": true,
  83. "maxSize": function(){},
  84. "restore": function(){},
  85. "setCurrent": function(){},
  86. "hide": function(){},
  87. "maxOrRestoreSize": function(){},
  88. "restoreSize": function(){},
  89. "close": function(){},
  90. "titleText" : {
  91. set : function(){}
  92. }
  93. };
  94. this.window.content = this.content;
  95. //this.content = this.window.content;
  96. //this.content.setStyles({"height": "100%", "overflow": "hidden"});
  97. //window.addEvent("resize", function(){
  98. // this.fireAppEvent("resize");
  99. //}.bind(this));
  100. //window.onbeforeunload = function(e){
  101. // this.fireAppEvent("queryClose");
  102. //}.bind(this);
  103. this.fireAppEvent("postLoadWindow");
  104. this.fireAppEvent("queryLoadApplication");
  105. this.setContentEvent();
  106. this.loadApplication(function(){
  107. this.fireAppEvent("postLoadApplication");
  108. }.bind(this));
  109. //this.content.setStyle("height", document.body.getSize().y);
  110. this.fireAppEvent("postLoad");
  111. },
  112. createNode: function(){
  113. this.content.setStyle("overflow", "hidden");
  114. this.node = new Element("div.node", {
  115. "styles": {"width": "100%", "height": "100%", "overflow": "hidden"}
  116. }).inject(this.container);
  117. }
  118. });