MainInContainer.js 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. MWF.xDesktop.requireApp("cms.Document", "lp."+o2.language, null, false);
  2. MWF.xDesktop.requireApp("cms.Document", "Main", null, false);
  3. MWF.xApplication.cms.Document.MainInContainer = new Class({
  4. Extends: MWF.xApplication.cms.Document.Main,
  5. Implements: [Options, Events],
  6. options: {
  7. "style": "default",
  8. "name": "cms.Document"
  9. },
  10. initialize: function(desktop, options, container, content, scrollNode){
  11. this.setOptions(options);
  12. this.desktop = desktop;
  13. this.container = container;
  14. this.content = content;
  15. this.scrollNode = scrollNode;
  16. this.path = "../x_component_"+this.options.name.replace(/\./g, "_")+"/$Main/";
  17. this.options.icon = this.path+this.options.style+"/"+this.options.icon;
  18. this.cssPath =this.path+this.options.style+"/css.wcss";
  19. this.inBrowser = true;
  20. this.inContainer = true;
  21. this._loadCss();
  22. },
  23. loadInBrowser: function(){
  24. this.window = {
  25. "isHide": false,
  26. "isMax": true,
  27. "maxSize": function(){},
  28. "restore": function(){},
  29. "setCurrent": function(){},
  30. "hide": function(){},
  31. "maxOrRestoreSize": function(){},
  32. "restoreSize": function(){},
  33. "close": function(){},
  34. "titleText" : {
  35. set : function(){}
  36. }
  37. };
  38. this.window.content = this.content;
  39. //this.content = this.window.content;
  40. //this.content.setStyles({"height": "100%", "overflow": "hidden"});
  41. //window.addEvent("resize", function(){
  42. // this.fireAppEvent("resize");
  43. //}.bind(this));
  44. //window.onbeforeunload = function(e){
  45. // this.fireAppEvent("queryClose");
  46. //}.bind(this);
  47. this.fireAppEvent("postLoadWindow");
  48. this.fireAppEvent("queryLoadApplication");
  49. this.setContentEvent();
  50. this.loadApplication(function(){
  51. this.fireAppEvent("postLoadApplication");
  52. }.bind(this));
  53. //this.content.setStyle("height", document.body.getSize().y);
  54. this.fireAppEvent("postLoad");
  55. },
  56. createNode: function(){
  57. this.content.setStyle("overflow", "hidden");
  58. this.node = new Element("div.reportNode", {
  59. "styles": {"width": "100%", "height": "100%", "overflow": "hidden"}
  60. }).inject(this.container);
  61. }
  62. });