Skip to content

Commit b6d22b2

Browse files
committed
cosmetic changes
1 parent 8626683 commit b6d22b2

File tree

2 files changed

+24
-12
lines changed

2 files changed

+24
-12
lines changed

src/app/examples/workspaceLocalstorage.route.component.ts

+23-11
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,9 @@ const defaultConfig: IConfig = {
5858
width: 100%;
5959
height: 100%;
6060
}
61+
.bloc {
62+
height: 100%;
63+
}
6164
6265
.explanations {
6366
padding: 15px;
@@ -66,8 +69,16 @@ const defaultConfig: IConfig = {
6669
.panel {
6770
font-size: 100px;
6871
font-weight: bold;
69-
text-align: center;
7072
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;
7182
}
7283
`],
7384
template: `
@@ -86,17 +97,14 @@ const defaultConfig: IConfig = {
8697
<split-area *ngIf="row.visible"
8798
[order]="irow"
8899
[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">
91102
<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>
96104
<ng-template ngFor let-c [ngForOf]="config.columns">
97105
<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()"
100108
[class.active]="r.visible"
101109
class="btn btn-outline-warning">{{ r.type }}</button>
102110
</ng-template>
@@ -106,9 +114,12 @@ const defaultConfig: IConfig = {
106114
[class.active]="config.disabled"
107115
class="btn btn-outline-warning">Disable splitters</button>
108116
<br><br>
117+
<p>All areas size and visibility are saved to localStorage.</p>
109118
<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>
112123
</div>
113124
</split-area>
114125
</ng-template>
@@ -165,6 +176,7 @@ export class WorkspaceLocalstorageComponent implements OnInit {
165176
}
166177

167178
refreshColumnVisibility() {
179+
// Refresh columns visibility based on inside rows visibilities (If no row > hide column)
168180
this.config.columns.forEach((column, index) => {
169181
column.visible = column.rows.some(row => row.visible === true);
170182
});

src/app/home/home.route.component.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ import { Component } from '@angular/core';
3030
<div class="jumbotron">
3131
<h1>angular-split
3232
<a href="https://badge.fury.io/js/angular-split"><img src="https://badge.fury.io/js/angular-split.svg" alt="npm version" height="18"></a>
33-
<small><br>Angular (2+) UI library to split views using CSS flexbox layout.</small>
3433
</h1>
34+
<p>Angular UI library to split views and allow user dragging to resize areas using CSS flexbox layout.</p>
3535
<h4>Install npm module:</h4>
3636
<pre [innerText]="code1"></pre>
3737
<br>

0 commit comments

Comments
 (0)