$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);
+ }
+ });
}])