mirror of
https://github.com/ansible/awx.git
synced 2026-01-11 10:00:01 -03:30
fixed indicator loading on incorrect row
This commit is contained in:
parent
8c8db4c49a
commit
3985e248bf
@ -1061,20 +1061,6 @@ var tower = angular.module('Tower', [
|
||||
|
||||
|
||||
$rootScope.$on("$stateChangeStart", function (event, next, nextParams, prev) {
|
||||
// broadcast event change if editing crud object
|
||||
if ($location.$$path.split("/")[2]) {
|
||||
var list = $location.$$path.split("/")[1];
|
||||
var id = $location.$$path.split("/")[2];
|
||||
|
||||
delete $rootScope.listBeingEdited;
|
||||
delete $rootScope.rowBeingEdited;
|
||||
|
||||
$rootScope.$broadcast("EditIndicatorChange", list, id);
|
||||
} else if ($rootScope.addedAnItem) {
|
||||
delete $rootScope.addedAnItem;
|
||||
} else {
|
||||
$rootScope.$broadcast("RemoveIndicator");
|
||||
}
|
||||
|
||||
// this line removes the query params attached to a route
|
||||
if(prev && prev.$$route &&
|
||||
@ -1128,6 +1114,23 @@ var tower = angular.module('Tower', [
|
||||
activateTab();
|
||||
});
|
||||
|
||||
$rootScope.$on('$stateChangeSuccess', function(event, toState, toParams, fromState, fromParams) {
|
||||
// broadcast event change if editing crud object
|
||||
if ($location.$$path.split("/")[2]) {
|
||||
var list = $location.$$path.split("/")[1];
|
||||
var id = $location.$$path.split("/")[2];
|
||||
|
||||
delete $rootScope.listBeingEdited;
|
||||
delete $rootScope.rowBeingEdited;
|
||||
|
||||
$rootScope.$broadcast("EditIndicatorChange", list, id);
|
||||
} else if ($rootScope.addedAnItem) {
|
||||
delete $rootScope.addedAnItem;
|
||||
} else {
|
||||
$rootScope.$broadcast("RemoveIndicator");
|
||||
}
|
||||
});
|
||||
|
||||
if (!Authorization.getToken() || !Authorization.isUserLoggedIn()) {
|
||||
// User not authenticated, redirect to login page
|
||||
$rootScope.sessionExpired = false;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user