ReceivedExplorer.min.js 2.9 KB

1
  1. MWF.xDesktop.requireApp("Template","Explorer",null,false);MWF.xDesktop.requireApp("Template","MForm",null,false);MWF.xDesktop.requireApp("Minder","Common",null,false);MWF.xApplication.Minder.ReceivedExplorer=new Class({Extends:MWF.widget.Common,Implements:[Options,Events],options:{style:"default",defaultTreeNode:"root",defaultViewType:"list"},initialize:function(e,t,i){this.setOptions(i);this.path="/x_component_Minder/$MineExplorer/";this.cssPath="/x_component_Minder/$MineExplorer/"+this.options.style+"/css.wcss";this._loadCss();this.app=t;this.container=$(e)},load:function(){this.rightNode=new Element("div.rightNode",{styles:this.css.rightNode}).inject(this.container);this.toolbarNode=new Element("div",{styles:this.css.toolbarNode}).inject(this.rightNode);this.toolbar=new MWF.xApplication.Minder.Toolbar(this.toolbarNode,this,{availableTool:[["createMinder"],["share"]],viewType:this.options.defaultViewType});this.toolbar.load();this.listNode=new Element("div",{styles:this.css.listNode}).inject(this.rightNode);this.loadList({});this.resizeContent();this.resizeFun=this.resizeContent.bind(this);this.app.addEvent("resize",this.resizeFun)},destroy:function(){this.container.empty();this.app.removeEvent("resize",this.resizeFun)},resizeContent:function(){var e=this.app.content.getSize();this.rightNode.setStyle("width",e.x-70);this.listNode.setStyle("height",e.y-92);this.listNode.setStyle("width",e.x-113);this.toolbarNode.setStyle("width",e.x-70)},loadList:function(e){if(this.currentView)this.currentView.destroy();this.currentView=new MWF.xApplication.Minder.ReceivedExplorer.List(this.listNode,this.app,this,{templateUrl:this.path+this.options.style+(this.getViewType()=="list"?"/listItem_received.json":"/tileItem.json"),scrollEnable:true});this.currentView.viewType=this.getViewType();this.currentView.filterData=e;this.currentView.load()},getViewType:function(){return this.toolbar.getListType()},getCurrentFolderId:function(){return this.tree.getCurrentFolderId()},recordStatus:function(){return{defaultViewType:this.getViewType()}}});MWF.xApplication.Minder.ReceivedExplorer.List=new Class({Extends:MWF.xApplication.Minder.List,options:{scrollEnable:true,scrollType:"window"},_createDocument:function(e,t){return new MWF.xApplication.Minder.Document(this.viewNode,e,this.explorer,this,null,t)},_openDocument:function(e,t){var i="MinderEditor"+e.id;if(this.app.desktop.apps[i]){this.app.desktop.apps[i].setCurrent()}else{this.app.desktop.openApplication(null,"MinderEditor",{appId:i,folderId:e.folderId,id:e.id,isEdited:false,isNew:false,noticeText:"分享的文件只能查看"})}},_getCurrentPageData:function(t,e){if(!e)e=30;var i=this.items.length?this.items[this.items.length-1].data.id:"(0)";var s=this.filterData||{};if(this.sortType&&this.sortField){s.orderField=this.sortField;s.orderType=this.sortType}this.actions.listMyReceivedMind(i,e,s,function(e){if(!e.data)e.data=[];if(t)t(e)})}});