mirror of
https://github.com/ansible/awx.git
synced 2026-01-20 06:01:25 -03:30
added edit indicator to scheduler
This commit is contained in:
parent
20161b7ac4
commit
1dee434c7d
@ -1008,7 +1008,13 @@ var tower = angular.module('Tower', [
|
||||
}
|
||||
$rootScope.removeConfigReady = $rootScope.$on('ConfigReady', function() {
|
||||
// initially set row edit indicator for crud pages
|
||||
if ($location.$$path.split("/")[2]) {
|
||||
if ($location.$$path && $location.$$path.split("/")[3] && $location.$$path.split("/")[3] === "schedules") {
|
||||
var list = $location.$$path.split("/")[3];
|
||||
var id = $location.$$path.split("/")[4];
|
||||
$rootScope.listBeingEdited = list;
|
||||
$rootScope.rowBeingEdited = id;
|
||||
$rootScope.initialIndicatorLoad = true;
|
||||
} else if ($location.$$path.split("/")[2]) {
|
||||
var list = $location.$$path.split("/")[1];
|
||||
var id = $location.$$path.split("/")[2];
|
||||
$rootScope.listBeingEdited = list;
|
||||
@ -1149,7 +1155,19 @@ var tower = angular.module('Tower', [
|
||||
|
||||
$rootScope.$on('$stateChangeSuccess', function(event, toState, toParams, fromState, fromParams) {
|
||||
// broadcast event change if editing crud object
|
||||
if ($location.$$path.split("/")[2]) {
|
||||
if ($location.$$path && $location.$$path.split("/")[3] && $location.$$path.split("/")[3] === "schedules") {
|
||||
var list = $location.$$path.split("/")[3];
|
||||
var id = $location.$$path.split("/")[4];
|
||||
|
||||
if (!$rootScope.initialIndicatorLoad) {
|
||||
delete $rootScope.listBeingEdited;
|
||||
delete $rootScope.rowBeingEdited;
|
||||
} else {
|
||||
delete $rootScope.initialIndicatorLoad;
|
||||
}
|
||||
|
||||
$rootScope.$broadcast("EditIndicatorChange", list, id);
|
||||
} else if ($location.$$path.split("/")[2]) {
|
||||
var list = $location.$$path.split("/")[1];
|
||||
var id = $location.$$path.split("/")[2];
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user