Skip to content

Commit 93d9b60

Browse files
committed
full screen
1 parent a6890b6 commit 93d9b60

3 files changed

Lines changed: 24 additions & 8 deletions

File tree

src/app/layout/dashboard/dashboard.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
</div>
4242
</clr-modal> -->
4343

44-
<full-screen-modal [opened]="opened">
44+
<full-screen-modal [(opened)]="opened">
4545
<clr-wizard #wizard [(clrWizardOpen)]="opened" style="height: 100%;" [clrWizardSize]="'xl'" [clrWizardForceForwardNavigation]="true" class="clr-wizard--inline clr-wizard--no-shadow clr-wizard--no-title"
4646
[clrWizardPreventModalAnimation]="true">
4747
<clr-wizard-title>Jump-To Wizard</clr-wizard-title>

src/app/shared/components/full-screen-modal/full-screen-modal.component.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
<clr-modal [(clrModalOpen)]="opened" [clrModalSize]="'xl'" [clrModalClosable]="true" >
1+
<clr-modal [(clrModalOpen)]="opened" [clrModalSize]="'xl'" [clrModalClosable]="false" >
22

33
<h3 class="modal-title">I have a nice title
4+
<button class="close" style="margin-right: 10px" (click)="close()"><clr-icon [attr.shape] = "'close'"></clr-icon></button>
45
<button class="close" style="margin-right: 10px" (click)="toggleFullScreen()"><clr-icon [attr.shape] = "fullscreenShape"></clr-icon></button>
56
</h3>
67
<div class="modal-body" #ele>

src/app/shared/components/full-screen-modal/full-screen-modal.component.ts

Lines changed: 21 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Component, OnInit, Input, HostBinding, Output, EventEmitter, ViewChild, ElementRef, Renderer2 } from '@angular/core';
1+
import { Component, OnInit, Input, HostBinding, HostListener, Output, EventEmitter, ViewChild, ElementRef, Renderer2, OnChanges, SimpleChange} from '@angular/core';
22

33
import {
44
trigger,
@@ -13,15 +13,14 @@ import {
1313
templateUrl: './full-screen-modal.component.html',
1414
styleUrls: ['./full-screen-modal.component.scss']
1515
})
16-
export class FullScreenModalComponent implements OnInit {
16+
export class FullScreenModalComponent implements OnInit, OnChanges {
1717

18-
18+
@Output('clrModalOpenChange') _openChanged: EventEmitter<boolean> = new EventEmitter<boolean>(false);
1919

2020
@ViewChild('ele') ele: ElementRef;
2121

22-
@HostBinding('@layout') layout = 'normal';
23-
24-
@Input('opened') opened;
22+
@HostBinding('class.open')
23+
@Input('opened') opened = false;
2524

2625
private fullscreen = false;
2726

@@ -55,4 +54,20 @@ export class FullScreenModalComponent implements OnInit {
5554
return this.fullscreen ? 'window-restore' : 'window-max';
5655
}
5756

57+
ngOnChanges(changes: { [propName: string]: SimpleChange }): void {
58+
console.log(changes.opened);
59+
}
60+
61+
open(): void {
62+
if (this.opened === true) {
63+
return;
64+
}
65+
this.opened = true;
66+
this._openChanged.emit(true);
67+
}
68+
69+
close(): void {
70+
this.opened = false;
71+
this._openChanged.emit(false);
72+
}
5873
}

0 commit comments

Comments
 (0)