Skip to content
This repository was archived by the owner on Jun 22, 2020. It is now read-only.

Commit ee64e81

Browse files
committed
fixup
1 parent 395ba87 commit ee64e81

File tree

3 files changed

+39
-28
lines changed

3 files changed

+39
-28
lines changed

projects/table-builder/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@angular-ru/ng-table-builder",
3-
"version": "0.35.0",
3+
"version": "0.36.0",
44
"license": "MIT",
55
"bugs": {
66
"url": "https://github.com/Angular-RU/ng-table-builder/issues"

projects/table-builder/src/lib/table/directives/observer-view.directive.ts

Lines changed: 19 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2,31 +2,33 @@ import { AfterViewInit, Directive, ElementRef, EventEmitter, NgZone, OnDestroy,
22

33
@Directive({ selector: '[observerView]' })
44
export class ObserverViewDirective implements AfterViewInit, OnDestroy {
5-
@Output() public observeVisible: EventEmitter<boolean> = new EventEmitter();
5+
@Output() public observeVisible: EventEmitter<boolean> = new EventEmitter(true);
66
private observer: IntersectionObserver = null;
77
private previousRation: number = 0.0;
88
private frameId: number;
99

1010
constructor(private element: ElementRef, private readonly ngZone: NgZone) {}
1111

1212
public ngAfterViewInit(): void {
13-
this.observer = new IntersectionObserver(
14-
(entries: IntersectionObserverEntry[]): void => {
15-
entries.forEach(
16-
(entry: IntersectionObserverEntry): void => {
17-
this.ngZone.runOutsideAngular((): void => this.observeChange(entry));
18-
this.previousRation = entry.intersectionRatio;
19-
}
20-
);
21-
},
22-
{
23-
root: null,
24-
rootMargin: '0px 0px 0px 0px',
25-
threshold: [0]
26-
}
27-
);
13+
this.ngZone.runOutsideAngular(() => {
14+
this.observer = new IntersectionObserver(
15+
(entries: IntersectionObserverEntry[]): void => {
16+
entries.forEach(
17+
(entry: IntersectionObserverEntry): void => {
18+
this.ngZone.runOutsideAngular((): void => this.observeChange(entry));
19+
this.previousRation = entry.intersectionRatio;
20+
}
21+
);
22+
},
23+
{
24+
root: null,
25+
rootMargin: '0px 0px 0px 0px',
26+
threshold: [0]
27+
}
28+
);
2829

29-
this.observer.observe(this.element.nativeElement);
30+
this.observer.observe(this.element.nativeElement);
31+
});
3032
}
3133

3234
public ngOnDestroy(): void {

src/app/samples/sample-eleven/sample-eleven.component.html

Lines changed: 19 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -64,17 +64,26 @@
6464

6565
<ngx-context-menu-item>
6666
<ngx-menu-content icon></ngx-menu-content>
67-
<ngx-menu-content>Column list</ngx-menu-content>
67+
<ngx-menu-content>Column settings</ngx-menu-content>
6868

69-
<ngx-context-menu-item
70-
*ngFor="let column of table1.columnSchema"
71-
(onClick)="table1.toggleColumnVisibility(column.key); $event.preventDefault()"
72-
[visible]="column.isModel"
73-
>
74-
<ngx-menu-content no-margin>{{ column.key }}</ngx-menu-content>
75-
<ngx-menu-content no-margin align-center>
76-
<mat-checkbox color="primary" [checked]="column.isVisible"></mat-checkbox>
77-
</ngx-menu-content>
69+
<ngx-context-menu-item>
70+
<ngx-menu-content>List</ngx-menu-content>
71+
72+
<ngx-context-menu-item
73+
*ngFor="let column of table1.columnSchema"
74+
(onClick)="
75+
table1.toggleColumnVisibility(column.key); $event.preventDefault()
76+
"
77+
[visible]="column.isModel"
78+
>
79+
<ngx-menu-content no-margin>{{ column.key }}</ngx-menu-content>
80+
<ngx-menu-content no-margin align-center>
81+
<mat-checkbox
82+
color="primary"
83+
[checked]="column.isVisible"
84+
></mat-checkbox>
85+
</ngx-menu-content>
86+
</ngx-context-menu-item>
7887
</ngx-context-menu-item>
7988
</ngx-context-menu-item>
8089

0 commit comments

Comments
 (0)