From 85feb5abe5154351a649bab8b47cd4d51fc0b8ab Mon Sep 17 00:00:00 2001
From: juanf <juanf>
Date: Thu, 19 Jun 2014 14:41:56 +0000
Subject: [PATCH] SSDM-504: Link on the title to come back to pages that change
 with the title.

SVN: 31740
---
 .../html/js/controllers/MainController.js     | 10 ++++-----
 .../html/js/widgets/SideMenuWidget.js         | 21 ++++++++++++++++---
 2 files changed, 23 insertions(+), 8 deletions(-)

diff --git a/plasmid/source/core-plugins/newbrowser/1/as/webapps/newbrowser/html/js/controllers/MainController.js b/plasmid/source/core-plugins/newbrowser/1/as/webapps/newbrowser/html/js/controllers/MainController.js
index 70724ece792..fd8f51823d6 100644
--- a/plasmid/source/core-plugins/newbrowser/1/as/webapps/newbrowser/html/js/controllers/MainController.js
+++ b/plasmid/source/core-plugins/newbrowser/1/as/webapps/newbrowser/html/js/controllers/MainController.js
@@ -117,7 +117,7 @@ function MainController(profile) {
 							localReference.sideMenu.hideSideMenu();
 						}
 					} else {
-						localReference.changeView("showHelloPage", null);
+						localReference.changeView("showBlancPage", null);
 					}
 					Util.unblockUI();
 					
@@ -168,9 +168,9 @@ function MainController(profile) {
 				this._showInspectors();
 				window.scrollTo(0,0);
 				break;
-			case "showHelloPage":
-				document.title = "Main Menu";
-				this._showHelloPage();
+			case "showBlancPage":
+				document.title = "";
+				this._showBlancPage();
 				window.scrollTo(0,0);
 				break;
 			case "showSearchPage":
@@ -279,7 +279,7 @@ function MainController(profile) {
 		this.inspector.repaint();
 	}
 	
-	this._showHelloPage = function() {
+	this._showBlancPage = function() {
 		//Show Hello Page
 		$("#mainContainer").empty();
 		this.currentView = null;
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 9726b3a4159..6a29716bfa6 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
@@ -29,7 +29,7 @@ function SideMenuWidget(mainController, containerId, serverFacade) {
 	this._serverFacade = serverFacade;
 	this._menuDOMTitle = null;
 	this._menuDOMBody = null;
-	this._menuStructure = new SideMenuWidgetComponent(false, true, "Main Menu", null, { children : [] }, 'showHelloPage', null, "");
+	this._menuStructure = new SideMenuWidgetComponent(false, true, "Main Menu", null, { children : [] }, 'showBlancPage', null, "");
 	this._pointerToMenuNode = this._menuStructure;
 	this.isHidden = false;
 	
@@ -108,7 +108,7 @@ function SideMenuWidget(mainController, containerId, serverFacade) {
 				var newMenuIfSelectedSpace = {
 						children : []
 				}
-				var menuItemSpace = new SideMenuWidgetComponent(true, false, space.code,  _this._menuStructure, newMenuIfSelectedSpace, 'showHelloPage', null, "(Space)");
+				var menuItemSpace = new SideMenuWidgetComponent(true, false, space.code,  _this._menuStructure, newMenuIfSelectedSpace, 'showBlancPage', null, "(Space)");
 				_this._menuStructure.newMenuIfSelected.children.push(menuItemSpace);
 				
 				//Fill Projects
@@ -336,7 +336,22 @@ function SideMenuWidget(mainController, containerId, serverFacade) {
 			this._menuDOMTitle.append(backButton);
 		}
 		
-		var $mainTitle = $("<span>").append(menuToPaint.displayName + " " + menuToPaint.contextTitle);
+		var $titleAsTextOrLink = null;
+		if(menuToPaint.newViewIfSelected && menuToPaint.newViewIfSelected != "showBlancPage") {
+			$titleAsTextOrLink = $("<a>", { "href" : "javascript:void(0);" }).append(menuToPaint.displayName + " " + menuToPaint.contextTitle)
+			
+			var clickFunction = function(menuToPaint) {
+				return function() {
+					_this._mainController.changeView(menuToPaint.newViewIfSelected, menuToPaint.newViewIfSelectedData);
+				}
+			};
+			
+			$titleAsTextOrLink.click(clickFunction(menuToPaint));
+		} else {
+			$titleAsTextOrLink = menuToPaint.displayName + " " + menuToPaint.contextTitle;
+		}
+		
+		var $mainTitle = $("<span>").append($titleAsTextOrLink);
 		
 		if(isBackButtonShown) {
 			$mainTitle.css({
-- 
GitLab