Better "go to parent state" code

This commit is contained in:
Akita Noek 2016-06-08 14:33:18 -04:00
parent c601ca7738
commit c1f40f9cbf
8 changed files with 8 additions and 8 deletions

View File

@ -104,7 +104,7 @@ export function CredentialsList($scope, $rootScope, $location, $log,
.success(function () {
$scope.search(list.iterator);
if (new RegExp('/' + id + '$').test($location.$$url)) {
$state.transitionTo($state.current.name.replace(/[.][a-zA-Z]+$/, "")); /* go to the list view */
$state.go('^');
}
})
.error(function (data, status) {

View File

@ -248,7 +248,7 @@ export function ProjectsList ($scope, $rootScope, $location, $log, $stateParams,
.success(function () {
$scope.search(list.iterator);
if (new RegExp('/' + id + '$').test($location.$$url)) {
$state.transitionTo($state.current.name.replace(/[.][a-zA-Z]+$/, "")); /* go to the list view */
$state.go('^');
}
})
.error(function (data, status) {

View File

@ -99,7 +99,7 @@ export function TeamsList($scope, $rootScope, $location, $log, $stateParams,
$('#prompt-modal').modal('hide');
$scope.search(list.iterator);
if (new RegExp('/' + id + '$').test($location.$$url)) {
$state.transitionTo($state.current.name.replace(/[.][a-zA-Z]+$/, "")); /* go to the list view */
$state.go('^');
}
})
.error(function (data, status) {

View File

@ -113,7 +113,7 @@ export function UsersList($scope, $rootScope, $location, $log, $stateParams,
.success(function () {
$scope.search(list.iterator);
if (new RegExp('/' + id + '$').test($location.$$url)) {
$state.transitionTo($state.current.name.replace(/[.][a-zA-Z]+$/, "")); /* go to the list view */
$state.go('^');
}
})
.error(function (data, status) {

View File

@ -324,7 +324,7 @@ function InventoriesList($scope, $rootScope, $location, $log,
.success(function () {
$scope.search(list.iterator);
if (new RegExp('/' + id + '$').test($location.$$url)) {
$state.transitionTo($state.current.name.replace(/[.][a-zA-Z]+$/, "")); /* go to the list view */
$state.go('^');
}
})
.error(function (data, status) {

View File

@ -60,7 +60,7 @@ export default
.success(function () {
scope.search(list.iterator);
if (new RegExp('/' + id + '$').test($location.$$url)) {
$state.transitionTo($state.current.name.replace(/[.][a-zA-Z]+$/, "")); /* go to the list view */
$state.go('^');
}
})
.error(function (data, status) {

View File

@ -79,7 +79,7 @@ export default
.success(function () {
$scope.search(list.iterator);
if (new RegExp('/' + id + '$').test($location.$$url)) {
$state.transitionTo($state.current.name.replace(/[.][a-zA-Z]+$/, "")); /* go to the list view */
$state.go('^');
}
})
.error(function (data) {

View File

@ -184,7 +184,7 @@ export default
.success(function () {
scope.search(list.iterator);
if (new RegExp('/' + id + '$').test($location.$$url)) {
$state.transitionTo($state.current.name.replace(/[.][a-zA-Z]+$/, "")); /* go to the list view */
$state.go('^');
}
})
.error(function (data, status) {