Commit 57802226 authored by Romain DELEAU's avatar Romain DELEAU

step background-image only if its the first step of the line

parent 57439d05
......@@ -21,7 +21,7 @@
<div class="piece-form">
<div class="piece-form-title">Étape {{index+1}}</div>
<mat-icon class="piece-form-comment" fontIcon="comment" *ngIf="step.comments.length > 0"></mat-icon>
<textarea [(ngModel)]="step.description"></textarea>
<textarea [(ngModel)]="step.description" [style.background-image]="index == FirstStepIndex() ? urlIcon : ''"></textarea>
<div class="piece-form-duration">
<label for="duration">Durée</label>
<input name="duration" type="number" [(ngModel)]="step.duration" (input)="durationChange()"/>
......
......@@ -97,7 +97,6 @@
border-radius: 10px;
border: none;
resize: none;
background-image: url("../../../assets/background-images/step.png");
background-position: center;
background-repeat: no-repeat;
background-size: 100px;
......
......@@ -22,6 +22,7 @@ export class StepComponent implements OnInit {
displayMenu: string = 'hide';
pieceWidth: number = 400;
urlIcon: string = 'url("../../../assets/background-images/step.png")';
constructor(protected pieceDetailsService: PieceDetailsService, public dialog: MatDialog, protected tooltipService: TooltipService) { }
......@@ -102,4 +103,13 @@ export class StepComponent implements OnInit {
this.displayMenu = 'hide';
this.mission.equalizeLengths();
}
FirstStepIndex(): number {
for(let i = 0; i < this.parent.chronologie.length; i++) {
if (this.parent.chronologie[i] instanceof Step) {
return i;
}
}
return 0;
}
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment