mirror of
https://github.com/ansible/awx.git
synced 2026-02-16 18:50:04 -03:30
try 1 at getting row indicator
This commit is contained in:
@@ -2085,3 +2085,7 @@ button.dropdown-toggle,
|
||||
.error.ng-hide {
|
||||
opacity: 0;
|
||||
}
|
||||
|
||||
.editedRow {
|
||||
border-left: 5px solid red;
|
||||
}
|
||||
|
||||
@@ -966,6 +966,14 @@ var tower = angular.module('Tower', [
|
||||
$rootScope.removeConfigReady();
|
||||
}
|
||||
$rootScope.removeConfigReady = $rootScope.$on('ConfigReady', function() {
|
||||
// initially set row edit indicator for crud pages
|
||||
if ($location.$$path.split("/")[2]) {
|
||||
var list = $location.$$path.split("/")[1];
|
||||
var id = $location.$$path.split("/")[2];
|
||||
$rootScope.listBeingEdited = list;
|
||||
$rootScope.rowBeingEdited = id;
|
||||
}
|
||||
|
||||
LoadBasePaths();
|
||||
|
||||
$rootScope.crumbCache = [];
|
||||
@@ -1048,7 +1056,19 @@ var tower = angular.module('Tower', [
|
||||
},2000);
|
||||
});
|
||||
|
||||
|
||||
$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);
|
||||
}
|
||||
|
||||
// this line removes the query params attached to a route
|
||||
if(prev && prev.$$route &&
|
||||
prev.$$route.name === 'systemTracking'){
|
||||
|
||||
@@ -170,6 +170,14 @@ export default ['$location', '$compile', '$rootScope', 'SearchWidget', 'Paginate
|
||||
this.scope.list = list;
|
||||
this.scope.mode = options.mode;
|
||||
|
||||
// respond to changes to the edit indicator from
|
||||
// the stateChangeStart event in app.js
|
||||
this.scope.$on("EditIndicatorChange", function(e, list, id) {
|
||||
e.targetScope.listBeingEdited = list;
|
||||
e.targetScope.rowBeingEdited = id;
|
||||
console.log(list, id);
|
||||
});
|
||||
|
||||
this.scope.isHiddenByOptions = function(options) {
|
||||
|
||||
// If neither ngHide nor ngShow are specified we
|
||||
@@ -439,6 +447,7 @@ export default ['$location', '$compile', '$rootScope', 'SearchWidget', 'Paginate
|
||||
if (list.multiSelect) {
|
||||
innerTable += ", " + list.iterator + ".isSelected ? 'is-selected-row' : ''";
|
||||
}
|
||||
innerTable += ", rowBeingEdited === '{{ " + list.iterator + ".id }}' && listBeingEdited === '" + list.name + "' ? 'editedRow' : ''";
|
||||
innerTable += "]\" ";
|
||||
innerTable += "id=\"{{ " + list.iterator + ".id }}\" ";
|
||||
innerTable += "class=\"" + list.iterator + "_class\" ";
|
||||
|
||||
Reference in New Issue
Block a user