MainInContainer.js 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. MWF.xDesktop.requireApp("MinderEditor", "lp."+MWF.language, null, false);
  2. MWF.xDesktop.requireApp("MinderEditor", "Main", null, false);
  3. MWF.xApplication.MinderEditor.MainInContainer = new Class({
  4. Extends: MWF.xApplication.MinderEditor.Main,
  5. Implements: [Options, Events],
  6. options: {
  7. "style": "default",
  8. "name": "MinderEditor"
  9. },
  10. initialize: function(desktop, options, container, content, scrollNode){
  11. this.setOptions(options);
  12. this.desktop = desktop;
  13. this.container = container; //container, 脑图内容容器
  14. this.content = content; //content, 父app的 content,比如 在流程或者门户 app的 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. debugger;
  23. },
  24. loadInBrowser: function(){
  25. this.window = {
  26. "isHide": false,
  27. "isMax": true,
  28. "maxSize": function(){},
  29. "restore": function(){},
  30. "setCurrent": function(){},
  31. "hide": function(){},
  32. "maxOrRestoreSize": function(){},
  33. "restoreSize": function(){},
  34. "close": function(){},
  35. "titleText" : {
  36. set : function(){}
  37. }
  38. };
  39. this.window.content = this.content;
  40. //this.content = this.window.content;
  41. //this.content.setStyles({"height": "100%", "overflow": "hidden"});
  42. //window.addEvent("resize", function(){
  43. // this.fireAppEvent("resize");
  44. //}.bind(this));
  45. //window.onbeforeunload = function(e){
  46. // this.fireAppEvent("queryClose");
  47. //}.bind(this);
  48. this.fireAppEvent("postLoadWindow");
  49. this.fireAppEvent("queryLoadApplication");
  50. this.setContentEvent();
  51. this.loadApplication(function(){
  52. this.fireAppEvent("postLoadApplication");
  53. }.bind(this));
  54. //this.content.setStyle("height", document.body.getSize().y);
  55. this.fireAppEvent("postLoad");
  56. },
  57. createNode: function(){
  58. this.content.setStyle("overflow", "hidden");
  59. this.node = new Element("div", {
  60. "styles": {"width": "100%", "height": "100%", "overflow": "hidden"}
  61. }).inject(this.container);
  62. this._createNode()
  63. }
  64. });