...
Code Block | ||
---|---|---|
| ||
cbx.lib.workspaceContainer = Class(cbx.core.Component, { workspaceID: '', proportion: '', containerObj : null, constructor: function(config) { cbx.lib.workspaceContainer.$super.call(this); this.workspaceID = config.WORKSPACE_ID; this.createContainer(); if($("#"+this.workspaceID)[0]){ $("#"+this.workspaceID)[0].style.display="block"; this.createItems(); $("#"+this.workspaceID).children().remove(); $("#"+this.workspaceID).append(this.containerObj); } else{ LOGGER.error("The workspace trying to be enabled is not a valid " + "workspace for this channel.." + " WORKSPACE ID: "+this.workspaceID); } }, //Returns Workspace container object getWSContainer: function() { return this.getItem(0); }, createContainer : function(){ var wsContainerConfig ={ "eleType":"div", "id":this.workspaceID+"_WORKSPACE_CONTAINER" }; var container = new cbx.lib.layer(wsContainerConfig).getLayer(); $(this.workspaceID).append(container); this.containerObj = container; this.addItem(this.containerObj) }, createItems: function() { var menuContainerConfig = { "eleType":"div", "class":this.workspaceID+"_MENU_CONTAINER", "id":this.workspaceID+"_MENU_CONTAINER" } var menuContainer = new cbx.lib.layer(menuContainerConfig).getLayer(); var menuItems = iportalcanvas.menuitems.metadata.getMenuTools(this.workspaceID); var layoutContainerConfig = { "eleType":"div", "class":this.workspaceID+"_LAYOUT_CONTAINER", "id":this.workspaceID+"_LAYOUT_CONTAINER" } var subWorkspaceConf = { "elem":layoutContainerParent, "workspaceId":this.workspaceID } /** * Instantiate layout manager on this Container */ this.layoutManager = new cbx.core.LayoutManager(subWorkspaceConf); }, getLayoutManagerObject: function() { return this.layoutManager; }, getLayoutManagerDOM: function() { return this.layoutManager.getContainer(); }, getWorkspaceWidgets: function() { return this.layoutManager.getWidgetContainerComponent(); }, getWidgetContainer : function(){ return this.layoutManager.widgetContainer; }, getLayoutContainer : function(){ return this.layoutManager.widgetContainer; } }); CLCR.registerCmp({'COMP_TYPE':'WORKSPACE_CONTAINER'}, cbx.lib.workspaceContainer); |
...