Skip to content

Commit 3f0a4ab

Browse files
committed
convert var declaration to const
1 parent 13de0aa commit 3f0a4ab

File tree

1 file changed

+8
-9
lines changed

1 file changed

+8
-9
lines changed

src/split.component.ts

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ interface Point {
4242
template: `
4343
<ng-content></ng-content>
4444
<template ngFor let-area [ngForOf]="areas" let-index="index" let-last="last">
45-
<split-gutter *ngIf="last === false && area.component.visible && !isLastVisibleArea(area)"
45+
<split-gutter *ngIf="last === false && area.component.visible === true && !isLastVisibleArea(area)"
4646
[order]="index*2+1"
4747
[direction]="direction"
4848
[size]="gutterSize"
@@ -100,12 +100,6 @@ export class SplitComponent implements OnChanges, OnDestroy {
100100
}
101101
}
102102

103-
public isLastVisibleArea(area: IAreaData) {
104-
var visibleAreas = this.visibleAreas;
105-
106-
return visibleAreas.length > 0 ? area === visibleAreas[visibleAreas.length - 1] : false;
107-
}
108-
109103
public addArea(component: SplitAreaDirective, orderUser: number | null, sizeUser: number | null, minPixel: number) {
110104
this.areas.push({
111105
component,
@@ -159,10 +153,15 @@ export class SplitComponent implements OnChanges, OnDestroy {
159153
}
160154
}
161155

156+
public isLastVisibleArea(area: IAreaData) {
157+
const visibleAreas = this.visibleAreas;
158+
return visibleAreas.length > 0 ? area === visibleAreas[visibleAreas.length - 1] : false;
159+
}
160+
162161
private refresh() {
163162
this.stopDragging();
164163

165-
var visibleAreas = this.visibleAreas;
164+
const visibleAreas = this.visibleAreas;
166165

167166
// ORDERS: Set css 'order' property depending on user input or added order
168167
const nbCorrectOrder = this.areas.filter(a => a.orderUser !== null && !isNaN(a.orderUser)).length;
@@ -191,7 +190,7 @@ export class SplitComponent implements OnChanges, OnDestroy {
191190
}
192191

193192
private refreshStyleSizes() {
194-
var visibleAreas = this.visibleAreas;
193+
const visibleAreas = this.visibleAreas;
195194

196195
const f = this.gutterSize * this.nbGutters / visibleAreas.length;
197196
visibleAreas.forEach(a => a.component.setStyle('flex-basis', `calc( ${a.size}% - ${f}px )`));

0 commit comments

Comments
 (0)