diff --git a/plasmid/source/core-plugins/newbrowser/1/as/webapps/newbrowser/html/js/widgets/SideMenuWidget.js b/plasmid/source/core-plugins/newbrowser/1/as/webapps/newbrowser/html/js/widgets/SideMenuWidget.js index 8ca10dba2639e5479979c999b4163834471cece0..c4b9f24f6aded2b48e75ef396499b713bdf92fb1 100644 --- a/plasmid/source/core-plugins/newbrowser/1/as/webapps/newbrowser/html/js/widgets/SideMenuWidget.js +++ b/plasmid/source/core-plugins/newbrowser/1/as/webapps/newbrowser/html/js/widgets/SideMenuWidget.js @@ -33,6 +33,18 @@ function SideMenuWidget(mainController, containerId, serverFacade) { this._pointerToMenuNode = this._menuStructure; this.isHidden = false; + this.refreshProject = function(spaceCode, projectCode) { + var menuItemSpace = this._getSpaceNodeForCode(spaceCode); + var newMenuIfSelectedProject = { + children : [] + } + var projectIdentifier = "/" + spaceCode + "/" + projectCode; + var menuItemProject = new SideMenuWidgetComponent(true, false, projectCode, menuItemSpace, newMenuIfSelectedProject, "showProjectPageFromIdentifier", projectIdentifier, "(Project)"); + menuItemSpace.newMenuIfSelected.children.push(menuItemProject); + + this.repaint(); + } + this.refreshExperiment = function(projectIdentifierToAskForExperiments) { var _this = this; @@ -108,6 +120,19 @@ function SideMenuWidget(mainController, containerId, serverFacade) { }); } + this._getSpaceNodeForCode = function(spaceCode) { + for(var sIdx = 0; sIdx < this._menuStructure.newMenuIfSelected.children.length; sIdx++) { + var spaceNode = this._menuStructure.newMenuIfSelected.children[sIdx]; + if(spaceNode.isTitle && !spaceNode.isSelectable) { + continue; + } + if(spaceNode.displayName === spaceCode) { + return spaceNode; + } + } + return null; + } + this._getProjectNodeForCode = function(projectCode) { for(var sIdx = 0; sIdx < this._menuStructure.newMenuIfSelected.children.length; sIdx++) { var spaceNode = this._menuStructure.newMenuIfSelected.children[sIdx];