Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
V
verona-modules-aspect
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Requirements
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
IQB
verona-modules-aspect
Commits
ab3d7fe0
Commit
ab3d7fe0
authored
1 year ago
by
rhenck
Browse files
Options
Downloads
Patches
Plain Diff
Rework DropList option dialog
parent
0dea62a4
No related branches found
Branches containing commit
Tags
editor/2.3.0+player/2.3.0
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
projects/editor/src/app/components/dialogs/drop-list-option-edit-dialog.component.ts
+80
-47
80 additions, 47 deletions
...ponents/dialogs/drop-list-option-edit-dialog.component.ts
projects/editor/src/app/services/dialog.service.ts
+3
-1
3 additions, 1 deletion
projects/editor/src/app/services/dialog.service.ts
with
83 additions
and
48 deletions
projects/editor/src/app/components/dialogs/drop-list-option-edit-dialog.component.ts
+
80
−
47
View file @
ab3d7fe0
...
...
@@ -6,69 +6,102 @@ import { DragNDropValueObject } from 'common/models/elements/label-interfaces';
@
Component
({
selector
:
'
aspect-drop-list-option-edit-dialog
'
,
template
:
`
<mat-dialog-content class="fx-column-start-stretch fx-gap-20">
<mat-form-field>
<mat-label>{{'text' | translate }}</mat-label>
<input #textField matInput type="text" [value]="data.value.text">
</mat-form-field>
<div *ngIf="!audioSrc" class="fx-column-start-stretch fx-gap-3">
<button mat-raised-button (click)="loadImage()">{{ 'loadImage' | translate }}</button>
<button mat-raised-button (click)="imgSrc = null">{{ 'removeImage' | translate }}</button>
<img [src]="imgSrc"
[style.object-fit]="'scale-down'"
[width]="200">
</div>
<div *ngIf="!imgSrc" class="fx-column-start-stretch fx-gap-3">
<button mat-raised-button (click)="loadAudio()">
{{(audioSrc ? 'changeAudio' : 'loadAudio') | translate }}
</button>
<button mat-raised-button (click)="audioSrc = null">
{{ 'removeAudio' | translate }}
</button>
</div>
<mat-form-field>
<mat-label>{{'id' | translate }}</mat-label>
<input #idField matInput type="text" [value]="data.value.id">
</mat-form-field>
</mat-dialog-content>
<mat-dialog-actions>
<button mat-button [mat-dialog-close]="{
text: textField.value,
imgSrc: imgSrc,
audioSrc: audioSrc,
id: idField.value
}">
{{'save' | translate }}
</button>
<button mat-button mat-dialog-close>{{'cancel' | translate }}</button>
</mat-dialog-actions>
<div class="wrapper">
<h2 mat-dialog-title>Ablegelistenoption anpassen</h2>
<mat-dialog-content class="content">
<mat-form-field>
<mat-label>{{'text' | translate }}</mat-label>
<input matInput type="text" [(ngModel)]="newLabel.text">
</mat-form-field>
<mat-form-field>
<mat-label>{{'id' | translate }}</mat-label>
<input matInput type="text" [(ngModel)]="newLabel.id">
</mat-form-field>
<div class="media-panels">
<fieldset class="image-panel-controls">
<legend>Bild</legend>
<button mat-raised-button (click)="loadImage()">{{ 'loadImage' | translate }}</button>
<button mat-raised-button [disabled]="newLabel.imgSrc === null" (click)="newLabel.imgSrc = null">
{{ 'removeImage' | translate }}
</button>
<mat-form-field>
<mat-label>{{'imagePosition' | translate }}</mat-label>
<mat-select [(ngModel)]="newLabel.imgPosition"
[disabled]="newLabel.imgSrc == null">
<mat-option *ngFor="let option of ['above', 'below', 'left', 'right']"
[value]="option">
{{ option | translate }}
</mat-option>
</mat-select>
</mat-form-field>
</fieldset>
<fieldset>
<legend>Audio</legend>
<div class="image-panel-controls">
<button mat-raised-button (click)="loadAudio()">
{{(newLabel.audioSrc ? 'changeAudio' : 'loadAudio') | translate }}
</button>
<button mat-raised-button [disabled]="newLabel.audioSrc === null" (click)="newLabel.audioSrc = null">
{{ 'removeAudio' | translate }}
</button>
</div>
</fieldset>
</div>
<fieldset [style.height.px]="180" [style.margin-top.px]="10">
<legend>Vorschau</legend>
<aspect-text-image-panel [label]="newLabel" [style.justify-content]="'center'"></aspect-text-image-panel>
</fieldset>
</mat-dialog-content>
<mat-dialog-actions>
<button mat-button [mat-dialog-close]="newLabel">{{'save' | translate }}</button>
<button mat-button mat-dialog-close>{{'cancel' | translate }}</button>
</mat-dialog-actions>
</div>
`
,
styles
:
[
`
.fx-gap-3 {
gap: 3px;
}
.fx-gap-20 {
gap: 20px;
.wrapper {
display:flex;
flex-direction: column;
height: 100%;
}
.fx-column-start-stretch {
box-sizing: border-box;
.content {
display: flex;
flex-direction: column;
justify-content: flex-start;
align-items: stretch;
}
.image-panel-controls {
display: flex;
flex-direction: column;
gap: 10px;
}
aspect-text-image-panel {
margin-left: auto;
margin-right: auto;
}
.media-panels {
display: flex;
flex-direction: row;
}
.media-panels fieldset {
width: 50%;
}
`
]
})
export
class
DropListOptionEditDialogComponent
{
newLabel
=
{
...
this
.
data
.
value
};
constructor
(@
Inject
(
MAT_DIALOG_DATA
)
public
data
:
{
value
:
DragNDropValueObject
})
{
}
imgSrc
:
string
|
null
=
this
.
data
.
value
.
imgSrc
;
audioSrc
:
string
|
null
=
this
.
data
.
value
.
audioSrc
;
async
loadImage
():
Promise
<
void
>
{
this
.
imgSrc
=
await
FileService
.
loadImage
();
this
.
newLabel
.
imgSrc
=
await
FileService
.
loadImage
();
}
async
loadAudio
()
{
this
.
audioSrc
=
await
FileService
.
loadAudio
();
this
.
newLabel
.
audioSrc
=
await
FileService
.
loadAudio
();
}
}
This diff is collapsed.
Click to expand it.
projects/editor/src/app/services/dialog.service.ts
+
3
−
1
View file @
ab3d7fe0
...
...
@@ -87,7 +87,9 @@ export class DialogService {
showDropListOptionEditDialog
(
value
:
DragNDropValueObject
):
Observable
<
DragNDropValueObject
>
{
const
dialogRef
=
this
.
dialog
.
open
(
DropListOptionEditDialogComponent
,
{
data
:
{
value
}
data
:
{
value
},
height
:
'
700px
'
,
width
:
'
600px
'
});
return
dialogRef
.
afterClosed
();
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment