Change visibility type for panel hiding (#864)

* change visibility method for panels

* make the new visibility type opt in
This commit is contained in:
Anthony Dresser
2018-03-09 14:54:13 -08:00
committed by GitHub
parent bc4b399f87
commit fab4185c1f
6 changed files with 11 additions and 6 deletions

View File

@@ -109,4 +109,8 @@ panel {
.tabbedPanel > .title > .monaco-scrollable-element {
flex: 0 1 auto;
width: inherit;
}
}
.visibility.hidden {
visibility: hidden;
}

View File

@@ -13,7 +13,7 @@ export abstract class TabChild {
@Component({
selector: 'tab',
template: `
<div *ngIf="active" class="fullsize">
<div class="visibility" [class.hidden]="!active && visibilityType == 'visibility'" *ngIf="visibilityType == 'visibility' || active" class="fullsize">
<ng-content class="body fullsize"></ng-content>
</div>
`
@@ -25,6 +25,7 @@ export class TabComponent implements OnDestroy {
@Input() public actions: Array<Action>;
public _active = false;
@Input() public identifier: string;
@Input() private visibilityType: 'if' | 'visibility' = 'if';
public set active(val: boolean) {
this._active = val;

View File

@@ -5,7 +5,7 @@
*--------------------------------------------------------------------------------------------*/
-->
<panel class="dashboard-panel" (onTabChange)="handleTabChange($event)" (onTabClose)="handleTabClose($event)" [actions]="panelActions">
<tab *ngFor="let tab of tabs" [title]="tab.title" class="fullsize" [identifier]="tab.id" [canClose]="tab.canClose" [actions]="tab.actions">
<tab [visibilityType]="'visibility'" *ngFor="let tab of tabs" [title]="tab.title" class="fullsize" [identifier]="tab.id" [canClose]="tab.canClose" [actions]="tab.actions">
<dashboard-home-container *ngIf="tab.id === 'homeTab'; else not_home" [properties]="propertiesWidget" [tab]="tab">
</dashboard-home-container>
<ng-template #not_home>

View File

@@ -5,7 +5,7 @@
*--------------------------------------------------------------------------------------------*/
-->
<panel [options]="panelOpt" style="flex: 1 1 auto;" class="dashboard-panel" (onTabChange)="handleTabChange($event)">
<tab *ngFor="let tab of tabs" [title]="tab.title" class="fullsize" [identifier]="tab.id" [canClose]="tab.canClose" [actions]="tab.actions">
<tab [visibilityType]="'visibility'" *ngFor="let tab of tabs" [title]="tab.title" class="fullsize" [identifier]="tab.id" [canClose]="tab.canClose" [actions]="tab.actions">
<dashboard-webview-container *ngIf="getContentType(tab) === 'webview-container'" [tab]="tab">
</dashboard-webview-container>
<dashboard-widget-container *ngIf="getContentType(tab) === 'widgets-container'" [tab]="tab">

View File

@@ -48,7 +48,7 @@ export class WebviewContent implements OnInit, IDashboardWebview {
}
public layout(): void {
this._createWebview();
this._webview.layout();
}
public get id(): string {

View File

@@ -80,7 +80,7 @@ export class WebviewWidget extends DashboardWidget implements IDashboardWidget,
}
public layout(): void {
this._createWebview();
this._webview.layout();
}
public sendMessage(message: string): void {