From 5fff7d24ecd415b3a3f82f94d4e139b8238fa2f2 Mon Sep 17 00:00:00 2001 From: FinnStutzenstein Date: Fri, 8 Mar 2019 10:38:22 +0100 Subject: [PATCH] projector scroll and contdown offset --- .../projector/projector-repository.service.ts | 17 +++++--- .../slide-container.component.ts | 3 +- .../projector-detail.component.html | 43 ++++++++++++++++--- .../projector-detail.component.ts | 12 ++++-- .../countdown/countdown-slide.component.html | 2 +- client/src/styles.scss | 4 +- openslides/core/views.py | 15 ++++--- 7 files changed, 71 insertions(+), 25 deletions(-) diff --git a/client/src/app/core/repositories/projector/projector-repository.service.ts b/client/src/app/core/repositories/projector/projector-repository.service.ts index b36634b87..ec7b4916b 100644 --- a/client/src/app/core/repositories/projector/projector-repository.service.ts +++ b/client/src/app/core/repositories/projector/projector-repository.service.ts @@ -90,9 +90,10 @@ export class ProjectorRepositoryService extends BaseRepository { - await this.controlView(projector, direction, 'scroll'); + public async scroll(projector: ViewProjector, direction: ScrollScaleDirection, step: number = 1): Promise { + await this.controlView(projector, direction, 'scroll', step); } /** @@ -100,9 +101,10 @@ export class ProjectorRepositoryService extends BaseRepository { - await this.controlView(projector, direction, 'scale'); + public async scale(projector: ViewProjector, direction: ScrollScaleDirection, step: number = 1): Promise { + await this.controlView(projector, direction, 'scale', step); } /** @@ -111,15 +113,18 @@ export class ProjectorRepositoryService extends BaseRepository { await this.http.post(`/rest/core/projector/${projector.id}/control_view/`, { action: action, - direction: direction + direction: direction, + step: step }); } } diff --git a/client/src/app/shared/components/slide-container/slide-container.component.ts b/client/src/app/shared/components/slide-container/slide-container.component.ts index c7894675e..6128c411f 100644 --- a/client/src/app/shared/components/slide-container/slide-container.component.ts +++ b/client/src/app/shared/components/slide-container/slide-container.component.ts @@ -76,6 +76,7 @@ export class SlideContainerComponent extends BaseComponent { public set projector(projector: ViewProjector) { this._projector = projector; this.setProjectorForComponent(); + this.updateScroll(); } public get projector(): ViewProjector { @@ -137,7 +138,7 @@ export class SlideContainerComponent extends BaseComponent { private updateScroll(): void { if (this.slideOptions.scrollable) { let value = this.scroll; - value *= -50; + value *= -100; if (this.projector.show_header_footer) { value += 50; // Default offset for the header } diff --git a/client/src/app/site/projector/components/projector-detail/projector-detail.component.html b/client/src/app/site/projector/components/projector-detail/projector-detail.component.html index 6627c4441..cf4013911 100644 --- a/client/src/app/site/projector/components/projector-detail/projector-detail.component.html +++ b/client/src/app/site/projector/components/projector-detail/projector-detail.component.html @@ -29,14 +29,45 @@
{{ projector.scale }}
- - - - + + + + + +