Add elements to preview button

This commit is contained in:
FinnStutzenstein 2019-02-28 09:37:25 +01:00
parent f532a60b36
commit 80e236e5b0
4 changed files with 22 additions and 9 deletions

View File

@ -47,8 +47,14 @@ export class ProjectionDialogService {
});
const response = await dialogRef.afterClosed().toPromise();
if (response) {
const [projectors, projectorElement]: ProjectionDialogReturnType = response;
const [action, projectors, projectorElement]: ProjectionDialogReturnType = response;
if (action === 'project') {
this.projectorService.projectOnMultiple(projectors, projectorElement);
} else if (action === 'addToPreview') {
projectors.forEach(projector => {
this.projectorService.addElementToPreview(projector, projectorElement);
});
}
}
}
}

View File

@ -37,6 +37,7 @@
</div>
</mat-dialog-content>
<mat-dialog-actions>
<button mat-button osAutofocus (click)="onOk()" color="primary" translate>OK</button>
<button mat-button osAutofocus (click)="onProject()" color="primary" translate>Project</button>
<button mat-button (click)="onAddToPreview()" translate>Add to preview</button>
<button mat-button (click)="onCancel()" translate>Cancel</button>
</mat-dialog-actions>

View File

@ -14,7 +14,7 @@ import {
SlideOptions
} from 'app/site/base/slide-options';
export type ProjectionDialogReturnType = [Projector[], IdentifiableProjectorElement];
export type ProjectionDialogReturnType = ['project' | 'addToPreview', Projector[], IdentifiableProjectorElement];
/**
*/
@ -85,10 +85,16 @@ export class ProjectionDialogComponent {
return isSlideChoiceOption(option);
}
public onOk(): void {
public onProject(): void {
let element = this.projectorElementBuildDescriptor.getBasicProjectorElement(this.optionValues);
element = { ...element, ...this.optionValues };
this.dialogRef.close([this.selectedProjectors, element]);
this.dialogRef.close(['project', this.selectedProjectors, element]);
}
public onAddToPreview(): void {
let element = this.projectorElementBuildDescriptor.getBasicProjectorElement(this.optionValues);
element = { ...element, ...this.optionValues };
this.dialogRef.close(['addToPreview', this.selectedProjectors, element]);
}
public onCancel(): void {

View File

@ -50,9 +50,9 @@
</button>
</div>
<div class="queue">
<div class="queue" *ngIf="projector.elements_history.length">
<h5 translate>History</h5>
<p *ngFor="let elements of projector?.elements_history">
<p *ngFor="let elements of projector.elements_history">
{{ getSlideTitle(elements[0]) }}
</p>
</div>
@ -143,7 +143,7 @@
</mat-list>
</div>
<div class="queue">
<div class="queue" *ngIf="projector.elements_preview.length">
<h5 translate>Queue</h5>
<div cdkDropList class="drop-list" (cdkDropListDropped)="onSortingChange($event)">
<div class="list-entry" *ngFor="let element of projector.elements_preview; let i = index" cdkDrag>