From 627badaf69987c01811c477219fd943757a635f5 Mon Sep 17 00:00:00 2001 From: "Christopher Lott (Christopher) (cl778h)" Date: Mon, 12 Jun 2017 09:49:00 -0400 Subject: [PORTAL-16 PORTAL-18] Widget ms; staging Remove staging repositories from poms. Add widget microservice code base. Add portal unit tests. Repair defects. Normalize line endings. Change-Id: Ia5e48da2a3141b352439ecd548cddf918f4df585 Signed-off-by: Christopher Lott (cl778h) --- .../client/app/views/tabs/tabs.controller.js | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) (limited to 'ecomp-portal-FE-common/client/app/views/tabs') diff --git a/ecomp-portal-FE-common/client/app/views/tabs/tabs.controller.js b/ecomp-portal-FE-common/client/app/views/tabs/tabs.controller.js index 5a5b7e49..bab9ba5c 100644 --- a/ecomp-portal-FE-common/client/app/views/tabs/tabs.controller.js +++ b/ecomp-portal-FE-common/client/app/views/tabs/tabs.controller.js @@ -33,6 +33,12 @@ $rootScope.showFooter = ""; $cookies.putObject('show_app_header', false,{domain: cookieDomain, path : '/'}); + let getCookieDomain = function() { + return window.location.hostname; + } + let getContextPath=function() { + return window.location.pathname.substring( 0, window.location.pathname.lastIndexOf( '/' ) + 1 ); + } let noRefresh = function () { window.onbeforeunload = function(e) { @@ -72,8 +78,9 @@ if ($scope.tabs.length > 1) { noRefresh(); } - $cookies.putObject('cookieTabs', $scope.tabs,{domain: cookieDomain, path : '/'}); - $cookies.putObject('visInVisCookieTabs', $scope.tabs,{domain: cookieDomain, path : '/'}); + $cookies.putObject('cookieTabs', $scope.tabs,{domain: getCookieDomain(), path : getContextPath()}); + $cookies.putObject('visInVisCookieTabs', $scope.tabs,{domain: getCookieDomain(), path : getContextPath()}); + } }; @@ -92,8 +99,8 @@ if ($scope.tabs.length > 1) { noRefresh(); } - $cookies.putObject('cookieTabs', $scope.tabs,{domain: cookieDomain, path : '/'}); - $cookies.putObject('visInVisCookieTabs', $scope.tabs,{domain: cookieDomain, path : '/'}); + $cookies.putObject('cookieTabs', $scope.tabs,{domain: getCookieDomain(), path : getContextPath()}); + $cookies.putObject('visInVisCookieTabs', $scope.tabs,{domain: getCookieDomain(), path : getContextPath()}); } }; @@ -124,7 +131,7 @@ event.preventDefault(); event.stopPropagation(); $scope.tabs.splice(index, 1); - $cookies.putObject('cookieTabs', $scope.tabs,{domain: cookieDomain, path : '/'}); + $cookies.putObject('cookieTabs', $scope.tabs,{domain: getCookieDomain(), path : getContextPath()}); }; //adjust height of the tab due to the search popup being hidden -- cgit 1.2.3-korg