diff --git a/src/app/components/shared/_dialogs/present-comment/present-comment.component.html b/src/app/components/shared/_dialogs/present-comment/present-comment.component.html index 2e56acb91825f699a99a59066fe8c419c77527ea..e24779e17cf6ec0b48ea83488971abdca549817c 100644 --- a/src/app/components/shared/_dialogs/present-comment/present-comment.component.html +++ b/src/app/components/shared/_dialogs/present-comment/present-comment.component.html @@ -1,5 +1,5 @@ -<mat-slider min="2.1" max="6" step="0.2" value="1.2" thumbLabel tickInterval="auto" - [(ngModel)]="sliderValue" (change)="updateFontSize()" id="slider"></mat-slider> +<mat-slider min="1" max="2" step="0.1" thumbLabel tickInterval="auto" + (input)="updateFontSize($event)" id="slider"></mat-slider> <button id="exitButton" mat-raised-button color="warn" (click)="onCloseClick()"> <mat-icon >exit_to_app</mat-icon> </button> diff --git a/src/app/components/shared/_dialogs/present-comment/present-comment.component.ts b/src/app/components/shared/_dialogs/present-comment/present-comment.component.ts index c03c846cc3cde94e77ddda67ca6f66d1c977ee96..db98ecce3f438a190adff9d0ac4e9a8a86f6f084 100644 --- a/src/app/components/shared/_dialogs/present-comment/present-comment.component.ts +++ b/src/app/components/shared/_dialogs/present-comment/present-comment.component.ts @@ -9,7 +9,6 @@ import { TranslateService } from '@ngx-translate/core'; }) export class PresentCommentComponent implements OnInit { public body: string; - sliderValue = 0; constructor( public dialogRef: MatDialogRef<PresentCommentComponent>, @@ -25,8 +24,7 @@ export class PresentCommentComponent implements OnInit { this.dialogRef.close('close'); } - private updateFontSize(): void { - console.log(this.sliderValue); - document.getElementById('comment').style.fontSize = this.sliderValue + 'em'; + private updateFontSize(event: any): void { + document.getElementById('comment').style.fontSize = (event.value * 2.5) + 'em'; } } diff --git a/src/app/components/shared/comment/comment.component.ts b/src/app/components/shared/comment/comment.component.ts index ea3a50f65b7f9b9412279b263ba3aff8c7a39b58..64098002ef8eee3961fad84784c77f58a204739c 100644 --- a/src/app/components/shared/comment/comment.component.ts +++ b/src/app/components/shared/comment/comment.component.ts @@ -110,7 +110,20 @@ export class CommentComponent implements OnInit { }); } + goToFullScreen(element: Element): void { + if (element.requestFullscreen) { + element.requestFullscreen(); + } + } + + exitFullScreen(): void { + if (document.exitFullscreen) { + document.exitFullscreen(); + } + } + openPresentDialog(comment: Comment): void { + this.goToFullScreen(document.documentElement); if (this.isStudent === false) { this.wsCommentService.highlight(comment); } @@ -128,9 +141,8 @@ export class CommentComponent implements OnInit { dialogRef.afterClosed() .subscribe(result => { this.wsCommentService.lowlight(comment); - if (result === 'close') { - return; - } + this.exitFullScreen(); + }); } }