|
|
|
@ -74,6 +74,18 @@ export class WorkPackageTableTimelineService extends WorkPackageQueryStateServic |
|
|
|
|
public toggle() { |
|
|
|
|
let currentState = this.current; |
|
|
|
|
this.setVisible(!currentState.visible); |
|
|
|
|
|
|
|
|
|
if (this.isAutoZoomEnabled() === undefined) { |
|
|
|
|
this.toggleAutoZoomEnabled(true); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* On first opening, activate auto zoom. |
|
|
|
|
* Afterwards keep the zoom level. |
|
|
|
|
*/ |
|
|
|
|
if (!currentState.visible && this.isAutoZoomEnabled()) { |
|
|
|
|
this.toggleAutoZoom(true); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public setVisible(value:boolean) { |
|
|
|
@ -140,8 +152,12 @@ export class WorkPackageTableTimelineService extends WorkPackageQueryStateServic |
|
|
|
|
this.modify({ autoZoom: value }); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public isAutoZoomEnabled():boolean { |
|
|
|
|
return this.current.autoZoom; |
|
|
|
|
public isAutoZoomEnabled():boolean|undefined { |
|
|
|
|
return this.current.autoZoomEnabled; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public toggleAutoZoomEnabled(val = !this.current.autoZoomEnabled) { |
|
|
|
|
this.modify({ autoZoomEnabled: val }); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public get current():WorkPackageTableTimelineState { |
|
|
|
@ -166,7 +182,8 @@ export class WorkPackageTableTimelineService extends WorkPackageQueryStateServic |
|
|
|
|
|
|
|
|
|
private get defaultState():WorkPackageTableTimelineState { |
|
|
|
|
return { |
|
|
|
|
autoZoom: true, |
|
|
|
|
autoZoom: false, |
|
|
|
|
autoZoomEnabled: undefined, |
|
|
|
|
zoomLevel: 'days', |
|
|
|
|
visible: false, |
|
|
|
|
labels: this.defaultLabels |
|
|
|
|