From bf1a924248454fb07a4e519c305dfbc7b4f6dcf9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oliver=20G=C3=BCnther?= Date: Tue, 11 Apr 2017 14:24:01 +0200 Subject: [PATCH] Never refresh the timeline before its visible --- .../wp-table/timeline/wp-timeline-container.directive.ts | 7 +++++++ .../app/components/wp-table/timeline/wp-timeline.header.ts | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/frontend/app/components/wp-table/timeline/wp-timeline-container.directive.ts b/frontend/app/components/wp-table/timeline/wp-timeline-container.directive.ts index 23f6f9d432..eacbd8f842 100644 --- a/frontend/app/components/wp-table/timeline/wp-timeline-container.directive.ts +++ b/frontend/app/components/wp-table/timeline/wp-timeline-container.directive.ts @@ -48,6 +48,7 @@ import IDirective = angular.IDirective; import IScope = angular.IScope; import {WorkPackageRelationsService} from "../../wp-relations/wp-relations.service"; import {HalRequestService} from "../../api/api-v3/hal-request/hal-request.service"; +import {WorkPackageTableTimelineService} from '../../wp-fast-table/state/wp-table-timeline.service'; export class WorkPackageTimelineTableController { @@ -70,6 +71,7 @@ export class WorkPackageTimelineTableController { private TypeResource:any, private states:States, private halRequest:HalRequestService, + private wpTableTimeline:WorkPackageTableTimelineService, private wpRelations:WorkPackageRelationsService) { "ngInject"; @@ -109,6 +111,11 @@ export class WorkPackageTimelineTableController { } refreshView() { + if (!this.wpTableTimeline.isVisible) { + debugLog('refreshView() requested, but TL is invisible.'); + return; + } + if (!this.refreshViewRequested) { debugLog('refreshView() in timeline container'); setTimeout(() => { diff --git a/frontend/app/components/wp-table/timeline/wp-timeline.header.ts b/frontend/app/components/wp-table/timeline/wp-timeline.header.ts index 38e3bc905e..cc1a0b77bb 100644 --- a/frontend/app/components/wp-table/timeline/wp-timeline.header.ts +++ b/frontend/app/components/wp-table/timeline/wp-timeline.header.ts @@ -202,7 +202,7 @@ export class WpTimelineHeader { this.setupScrollbar(); } - this.containerHeight = jQuery(cssClassTableContainer).outerHeight() + this.headerHeight; + this.containerHeight = jQuery(cssClassTableContainer).outerHeight(); this.globalHeight = jQuery(cssClassTableBody).outerHeight(); this.marginTop = this.headerHeight;