From 0c3ba0d6b3da1293db6ed84d62ec9e7d4b92e235 Mon Sep 17 00:00:00 2001 From: Jared Tabor Date: Wed, 6 Jul 2016 14:38:52 -0700 Subject: [PATCH] Activity Stream toggle should close AS Clicking the toggle while on the AS page wouldn't always remove the AS --- awx/ui/client/src/bread-crumb/bread-crumb.directive.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/awx/ui/client/src/bread-crumb/bread-crumb.directive.js b/awx/ui/client/src/bread-crumb/bread-crumb.directive.js index 1cf035550a..790ab24674 100644 --- a/awx/ui/client/src/bread-crumb/bread-crumb.directive.js +++ b/awx/ui/client/src/bread-crumb/bread-crumb.directive.js @@ -6,7 +6,7 @@ export default templateUrl: templateUrl('bread-crumb/bread-crumb'), link: function(scope) { - var streamConfig = {}; + var streamConfig = {}, originalRoute; scope.showActivityStreamButton = false; scope.showRefreshButton = false; @@ -30,7 +30,7 @@ export default stateGoParams.id = $state.params[streamConfig.activityStreamId]; } } - + originalRoute = $state.current; $state.go('activityStream', stateGoParams); } // The user is navigating away from the activity stream - take them back from whence they came @@ -38,7 +38,10 @@ export default // Pull the previous state out of local storage var previousState = Store('previous_state'); - if(previousState && !Empty(previousState.name)) { + if(originalRoute) { + $state.go(originalRoute.name, originalRoute.fromParams); + } + else if(previousState && !Empty(previousState.name)) { $state.go(previousState.name, previousState.fromParams); } else {