@@ -58,6 +58,9 @@ const defaultConfig: IConfig = {
58
58
width: 100%;
59
59
height: 100%;
60
60
}
61
+ .bloc {
62
+ height: 100%;
63
+ }
61
64
62
65
.explanations {
63
66
padding: 15px;
@@ -66,8 +69,16 @@ const defaultConfig: IConfig = {
66
69
.panel {
67
70
font-size: 100px;
68
71
font-weight: bold;
69
- text-align: center;
70
72
color: #cccccc;
73
+
74
+ display: flex;
75
+ justify-content: center;
76
+ align-items: center;
77
+ height: 100%;
78
+ overflow: hidden;
79
+ }
80
+ .panel > p {
81
+ margin: 0;
71
82
}
72
83
` ] ,
73
84
template : `
@@ -86,17 +97,14 @@ const defaultConfig: IConfig = {
86
97
<split-area *ngIf="row.visible"
87
98
[order]="irow"
88
99
[size]="row.size">
89
- <div [ngSwitch]="row.type">
90
- <p *ngSwitchCase="'doc'" class="explanations">
100
+ <div [ngSwitch]="row.type" class="bloc" >
101
+ <div *ngSwitchCase="'doc'" class="explanations">
91
102
<sp-example-title [ex]="data"></sp-example-title>
92
- Here all areas sizes and visibilities are editable and saved to localStorage.<br>
93
- On component initialization, if present inside localStorage, it uses it.<br>
94
- You can drag any gutters or click following buttons to toggle areas visibility:
95
- <br>
103
+ <p>Toggle areas visibility using following buttons:</p>
96
104
<ng-template ngFor let-c [ngForOf]="config.columns">
97
105
<ng-template ngFor let-r [ngForOf]="c.rows">
98
- <button *ngIf="r.type !== 'doc'" #btn
99
- (click)="r.visible = !r.visible; refreshColumnVisibility(); btn.blur() "
106
+ <button *ngIf="r.type !== 'doc'"
107
+ (click)="r.visible = !r.visible; refreshColumnVisibility()"
100
108
[class.active]="r.visible"
101
109
class="btn btn-outline-warning">{{ r.type }}</button>
102
110
</ng-template>
@@ -106,9 +114,12 @@ const defaultConfig: IConfig = {
106
114
[class.active]="config.disabled"
107
115
class="btn btn-outline-warning">Disable splitters</button>
108
116
<br><br>
117
+ <p>All areas size and visibility are saved to localStorage.</p>
109
118
<button (click)="resetConfig()" class="btn btn-outline-warning">Reset localStorage</button>
110
- </p>
111
- <p *ngSwitchDefault class="panel">{{ row.type }}</p>
119
+ </div>
120
+ <div *ngSwitchDefault class="panel">
121
+ <p>{{ row.type }}</p>
122
+ </div>
112
123
</div>
113
124
</split-area>
114
125
</ng-template>
@@ -165,6 +176,7 @@ export class WorkspaceLocalstorageComponent implements OnInit {
165
176
}
166
177
167
178
refreshColumnVisibility ( ) {
179
+ // Refresh columns visibility based on inside rows visibilities (If no row > hide column)
168
180
this . config . columns . forEach ( ( column , index ) => {
169
181
column . visible = column . rows . some ( row => row . visible === true ) ;
170
182
} ) ;
0 commit comments