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

View File

@@ -170,13 +170,11 @@ function JobRenderService ($q, $sce, $window) {
this.getParentEvents = (uuid, list) => { this.getParentEvents = (uuid, list) => {
list = list || []; list = list || [];
// always push its parent if exists
if (this.record[uuid]) { list.push(uuid);
list.push(uuid); // if we can get grandparent in current visible lines, we also push it
if (this.record[uuid] && this.record[uuid].parents) {
if (this.record[uuid].parents) { list = list.concat(this.record[uuid].parents);
list = list.concat(this.record[uuid].parents);
}
} }
return list; return list;
@@ -212,6 +210,13 @@ function JobRenderService ($q, $sce, $window) {
if (current.parents) { if (current.parents) {
classList = current.parents.reduce((list, uuid) => `${list} child-of-${uuid}`, ''); 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) { if (!tdEvent) {