mirror of
https://dev.azure.com/hugendubel/ISA/_git/ISA-Frontend
synced 2025-12-28 22:42:11 +01:00
#1028 WA // Anmerkung styling
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
<div class="isa-flex isa-justify-content-space-between isa-align-items-center">
|
||||
<strong class="isa-mr-10">Anmerkung</strong>
|
||||
<input #commentInput type="text" class="comment" [formControl]="commentControl" />
|
||||
<button class="isa-btn" *ngIf="!!commentControl.value" (click)="commentControl.reset(''); save()">
|
||||
<input #commentInput type="text" class="comment" [formControl]="commentControl" (focus)="inputFocus()" (blur)="inputBlur()" />
|
||||
<button class="isa-btn" *ngIf="focused && !!commentControl.value" (click)="commentControl.reset(''); save()">
|
||||
<lib-icon width="12px" name="close"></lib-icon>
|
||||
</button>
|
||||
<button class="isa-btn isa-btn-secondary isa-p-0 isa-ml-10" *ngIf="commentControl.enabled && commentControl.dirty" (click)="save()">
|
||||
|
||||
@@ -9,6 +9,7 @@ input.comment {
|
||||
padding-top: 2px;
|
||||
background-color: transparent;
|
||||
font-size: inherit;
|
||||
color: #000;
|
||||
}
|
||||
|
||||
input.comment:active,
|
||||
|
||||
@@ -17,6 +17,8 @@ import { FormControl } from '@angular/forms';
|
||||
changeDetection: ChangeDetectionStrategy.OnPush,
|
||||
})
|
||||
export class ShelfOrderDetailsCommentComponent implements OnChanges {
|
||||
focused: boolean;
|
||||
|
||||
@Input()
|
||||
comment: string;
|
||||
|
||||
@@ -38,4 +40,15 @@ export class ShelfOrderDetailsCommentComponent implements OnChanges {
|
||||
save() {
|
||||
this.saveComment.emit(this.commentControl.value);
|
||||
}
|
||||
|
||||
inputFocus() {
|
||||
this.focused = true;
|
||||
}
|
||||
|
||||
inputBlur() {
|
||||
setTimeout(() => {
|
||||
this.focused = false;
|
||||
this.cdr.markForCheck();
|
||||
}, 500);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -127,4 +127,4 @@
|
||||
"tslint": "~5.11.0",
|
||||
"typescript": "~3.5.3"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user