diff --git a/client/src/app/site/cinema/components/cinema/cinema.component.html b/client/src/app/site/cinema/components/cinema/cinema.component.html index 70b6fc09f..1a39ce3c7 100644 --- a/client/src/app/site/cinema/components/cinema/cinema.component.html +++ b/client/src/app/site/cinema/components/cinema/cinema.component.html @@ -6,18 +6,11 @@
-

- {{ title }} - - open_in_new - -

+ +

+ {{ title }} +

+
@@ -25,6 +18,7 @@ [customTitle]="true" [speakers]="listOfSpeakers" *osPerms="permission.agendaCanSeeListOfSpeakers; and: listOfSpeakers" + (canReaddLastSpeakerEvent)="canReaddLastSpeaker = $event" >

@@ -37,19 +31,26 @@ - + + lock_open + + + + +

@@ -57,8 +58,11 @@ -

{{ projectorTitle | translate }}

-
+ +

{{ projectorTitle | translate }}

+
+ +
diff --git a/client/src/app/site/cinema/components/cinema/cinema.component.ts b/client/src/app/site/cinema/components/cinema/cinema.component.ts index 91e1b6712..71ff868ae 100644 --- a/client/src/app/site/cinema/components/cinema/cinema.component.ts +++ b/client/src/app/site/cinema/components/cinema/cinema.component.ts @@ -1,4 +1,4 @@ -import { ChangeDetectionStrategy, ChangeDetectorRef, Component, OnInit, ViewChild } from '@angular/core'; +import { AfterViewInit, ChangeDetectionStrategy, ChangeDetectorRef, Component, OnInit, ViewChild } from '@angular/core'; import { MatSnackBar } from '@angular/material/snack-bar'; import { Title } from '@angular/platform-browser'; @@ -22,12 +22,17 @@ import { CurrentListOfSpeakersService } from 'app/site/projector/services/curren styleUrls: ['./cinema.component.scss'], changeDetection: ChangeDetectionStrategy.OnPush }) -export class CinemaComponent extends BaseViewComponentDirective implements OnInit { +export class CinemaComponent extends BaseViewComponentDirective implements OnInit, AfterViewInit { public listOfSpeakers: ViewListOfSpeakers; public projector: ViewProjector; private currentProjectorElement: ProjectorElement; public projectedViewModel: BaseProjectableViewModel; + /** + * filled by child component + */ + public canReaddLastSpeaker: boolean; + public get title(): string { if (this.projectedViewModel) { return this.projectedViewModel.getListTitle(); @@ -109,7 +114,7 @@ export class CinemaComponent extends BaseViewComponentDirective implements OnIni } else { this.projectedViewModel = null; } - this.cd.markForCheck(); + this.delayedCheck(); }), this.closService.currentListOfSpeakersObservable.subscribe(clos => { this.listOfSpeakers = clos; @@ -118,7 +123,27 @@ export class CinemaComponent extends BaseViewComponentDirective implements OnIni ); } + public ngAfterViewInit(): void { + this.delayedCheck(); + } + public async toggleListOfSpeakersOpen(): Promise { await this.listOfSpeakersRepo.setListOpenness(this.listOfSpeakers, this.isLosClosed).catch(this.raiseError); } + + public async readdLastSpeaker(): Promise { + await this.listOfSpeakersRepo.readdLastSpeaker(this.listOfSpeakers).catch(this.raiseError); + } + + /** + * Ref Projector Update fireing and Projector content updates + * are not in sync. + * This is a deep projector issue, OpenSlides has no chance + * to really know when the projector content is ready + */ + private delayedCheck(): void { + setTimeout(() => { + this.cd.markForCheck(); + }, 2000); + } }