From 2ee75a53076e9faf59a6df00b59aff739d55e930 Mon Sep 17 00:00:00 2001 From: Galen Charlton Date: Tue, 25 Apr 2017 17:36:56 -0400 Subject: [PATCH] webstaff: serials: improvements to updating address bar Signed-off-by: Galen Charlton --- Open-ILS/web/js/ui/default/staff/serials/app.js | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/Open-ILS/web/js/ui/default/staff/serials/app.js b/Open-ILS/web/js/ui/default/staff/serials/app.js index 66e286dd31..e5eeb5aea1 100644 --- a/Open-ILS/web/js/ui/default/staff/serials/app.js +++ b/Open-ILS/web/js/ui/default/staff/serials/app.js @@ -50,12 +50,20 @@ function($scope , $routeParams , $location , egSerialsCoreSvc) { $location.path('/serials/' + $scope.bib_id + '/' + $scope.active_tab); } }); - $scope.$watch('ssub.id', function(newVal, oldVal) { -console.debug('changed?'); - if (oldVal != newVal) { - $location.path('/serials/' + $scope.bib_id + '/' + $scope.active_tab + - '/' + $scope.ssub.id); - } - }); } + $scope.$watch('ssub.id', function(newVal, oldVal) { + if (oldVal != newVal) { + $location.path('/serials/' + $scope.bib_id + '/' + $scope.active_tab + + '/' + $scope.ssub.id); + } + }); + $scope.$watch('active_tab', function(newVal, oldVal) { + if (oldVal != newVal) { + var new_path = '/serials/' + $scope.bib_id + '/' + $scope.active_tab; + if ($scope.ssub.id && $scope.active_tab != 'manage-subscriptions') { + new_path += '/' + $scope.ssub.id; + } + $location.path(new_path); + } + }); }]) -- 2.11.0