2019-06-26 19:33:05 +03:00
|
|
|
import { AfterViewInit, Component, Inject, PLATFORM_ID, ViewChild } from '@angular/core';
|
|
|
|
|
import { isPlatformBrowser } from '@angular/common';
|
|
|
|
|
import { NbLayoutComponent } from '@nebular/theme';
|
|
|
|
|
|
|
|
|
|
import { WindowModeBlockScrollService } from '../../services/window-mode-block-scroll.service';
|
2017-04-13 14:24:23 +03:00
|
|
|
|
|
|
|
|
@Component({
|
2017-05-06 15:35:15 +03:00
|
|
|
selector: 'ngx-one-column-layout',
|
2017-06-08 23:06:33 +03:00
|
|
|
styleUrls: ['./one-column.layout.scss'],
|
2017-04-13 14:24:23 +03:00
|
|
|
template: `
|
2019-06-24 16:28:21 +03:00
|
|
|
<nb-layout windowMode>
|
2017-08-01 17:42:21 +03:00
|
|
|
<nb-layout-header fixed>
|
2017-05-06 14:52:41 +03:00
|
|
|
<ngx-header></ngx-header>
|
2017-08-01 17:42:21 +03:00
|
|
|
</nb-layout-header>
|
2017-04-17 19:01:47 +03:00
|
|
|
|
2017-08-01 17:42:21 +03:00
|
|
|
<nb-sidebar class="menu-sidebar" tag="menu-sidebar" responsive>
|
|
|
|
|
<ng-content select="nb-menu"></ng-content>
|
|
|
|
|
</nb-sidebar>
|
2017-04-18 15:45:49 +03:00
|
|
|
|
2017-08-01 17:42:21 +03:00
|
|
|
<nb-layout-column>
|
2017-04-14 18:28:27 +03:00
|
|
|
<ng-content select="router-outlet"></ng-content>
|
2017-08-01 17:42:21 +03:00
|
|
|
</nb-layout-column>
|
2017-04-18 15:45:49 +03:00
|
|
|
|
2017-08-01 17:42:21 +03:00
|
|
|
<nb-layout-footer fixed>
|
2017-05-06 14:52:41 +03:00
|
|
|
<ngx-footer></ngx-footer>
|
2017-08-01 17:42:21 +03:00
|
|
|
</nb-layout-footer>
|
|
|
|
|
</nb-layout>
|
2017-04-13 14:24:23 +03:00
|
|
|
`,
|
|
|
|
|
})
|
2019-06-26 19:33:05 +03:00
|
|
|
export class OneColumnLayoutComponent implements AfterViewInit {
|
|
|
|
|
|
|
|
|
|
@ViewChild(NbLayoutComponent, { static: false }) layout: NbLayoutComponent;
|
|
|
|
|
|
|
|
|
|
constructor(
|
|
|
|
|
@Inject(PLATFORM_ID) private platformId,
|
|
|
|
|
private windowModeBlockScrollService: WindowModeBlockScrollService,
|
|
|
|
|
) {}
|
|
|
|
|
|
|
|
|
|
ngAfterViewInit() {
|
|
|
|
|
if (isPlatformBrowser(this.platformId)) {
|
|
|
|
|
this.windowModeBlockScrollService.register(this.layout);
|
|
|
|
|
}
|
|
|
|
|
}
|
2017-04-13 14:24:23 +03:00
|
|
|
}
|