1
0
mirror of https://github.com/ansible/awx.git synced 2024-10-31 23:51:09 +03:00

Merge pull request #2282 from Haokun-Chen/fixed-toggle-menu

fix toggle menu when scroll up
This commit is contained in:
Jake McDermott 2018-06-22 15:38:09 -04:00 committed by GitHub
commit 46223d3cbf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -170,13 +170,11 @@ function JobRenderService ($q, $sce, $window) {
this.getParentEvents = (uuid, list) => {
list = list || [];
if (this.record[uuid]) {
list.push(uuid);
if (this.record[uuid].parents) {
list = list.concat(this.record[uuid].parents);
}
// always push its parent if exists
list.push(uuid);
// if we can get grandparent in current visible lines, we also push it
if (this.record[uuid] && this.record[uuid].parents) {
list = list.concat(this.record[uuid].parents);
}
return list;
@ -212,6 +210,13 @@ function JobRenderService ($q, $sce, $window) {
if (current.parents) {
classList = current.parents.reduce((list, uuid) => `${list} child-of-${uuid}`, '');
}
// if a row has children, and has parent,
// we grab all its children and append parent to its children
if (id !== '' && current.parents) {
const children = $(`.child-of-${current.uuid}`);
const parentId = current.parents[0];
children.addClass(`child-of-${parentId}`);
}
}
if (!tdEvent) {