On Job Template save: redirect to proper dest

return to job template list if adding/editing a job template from the list; likewise return to hte inventory properties if adding/editing from that page
This commit is contained in:
Jared Tabor
2015-03-18 15:15:48 -04:00
parent 0948846530
commit 206fb6b288
3 changed files with 57 additions and 14 deletions
+22 -2
View File
@@ -486,7 +486,17 @@ export function JobTemplatesAdd($scope, $rootScope, $compile, $location, $log, $
function saveCompleted() {
setTimeout(function() { $scope.$apply(function() { $location.path('/job_templates'); }); }, 500);
setTimeout(function() {
$scope.$apply(function() {
var base = $location.path().replace(/^\//, '').split('/')[0];
if (base === 'job_templates') {
ReturnToCaller();
}
else {
ReturnToCaller(1);
}
});
}, 500);
}
if ($scope.removeTemplateSaveSuccess) {
@@ -979,7 +989,17 @@ export function JobTemplatesEdit($scope, $rootScope, $compile, $location, $log,
});
function saveCompleted() {
setTimeout(function() { $scope.$apply(function() { $location.path('/job_templates'); }); }, 500);
setTimeout(function() {
$scope.$apply(function() {
var base = $location.path().replace(/^\//, '').split('/')[0];
if (base === 'job_templates') {
ReturnToCaller();
}
else {
ReturnToCaller(1);
}
});
}, 500);
}
if ($scope.removeTemplateSaveSuccess) {