Skip to content

Commit f8abcbf

Browse files
committed
asymmetry: fix perlenkette edit mode + fix numberOfStops input field
Signed-off-by: Louis Greiner <[email protected]>
1 parent 184b87a commit f8abcbf

File tree

2 files changed

+76
-23
lines changed

2 files changed

+76
-23
lines changed

src/app/perlenkette/perlenkette-section/perlenkette-section.component.html

Lines changed: 75 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,10 @@
321321
tabindex="-1"
322322
mode="ghost"
323323
class="ButtonMinus"
324-
(click)="trainrunSectionTimesService.onNodeLeftArrivalTimeButtonMinus()"
324+
(click)="
325+
trainrunSectionTimesService.onNodeLeftArrivalTimeButtonMinus();
326+
stopPropagation($event)
327+
"
325328
>
326329
-
327330
</button>
@@ -344,7 +347,10 @@
344347
tabindex="-1"
345348
mode="ghost"
346349
class="ButtonPlus"
347-
(click)="trainrunSectionTimesService.onNodeLeftArrivalTimeButtonPlus()"
350+
(click)="
351+
trainrunSectionTimesService.onNodeLeftArrivalTimeButtonPlus();
352+
stopPropagation($event)
353+
"
348354
>
349355
+
350356
</button>
@@ -369,7 +375,9 @@
369375
height="25px"
370376
width="25px"
371377
aria-hidden="false"
372-
(click)="trainrunSectionTimesService.onButtonNodeLeftLock()"
378+
(click)="
379+
trainrunSectionTimesService.onButtonNodeLeftLock(); stopPropagation($event)
380+
"
373381
title="Ab-/Ankunftszeit 'lock'"
374382
>
375383
</sbb-icon>
@@ -380,7 +388,9 @@
380388
height="25px"
381389
width="25px"
382390
aria-hidden="false"
383-
(click)="trainrunSectionTimesService.onButtonNodeLeftLock()"
391+
(click)="
392+
trainrunSectionTimesService.onButtonNodeLeftLock(); stopPropagation($event)
393+
"
384394
title="Ab-/Ankunftszeit 'lock' entfernen"
385395
>
386396
</sbb-icon>
@@ -399,7 +409,10 @@
399409
tabindex="-1"
400410
mode="ghost"
401411
class="ButtonMinus"
402-
(click)="trainrunSectionTimesService.onNodeLeftDepartureTimeButtonMinus()"
412+
(click)="
413+
trainrunSectionTimesService.onNodeLeftDepartureTimeButtonMinus();
414+
stopPropagation($event)
415+
"
403416
>
404417
-
405418
</button>
@@ -422,7 +435,10 @@
422435
tabindex="-1"
423436
mode="ghost"
424437
class="ButtonPlus"
425-
(click)="trainrunSectionTimesService.onNodeLeftDepartureTimeButtonPlus()"
438+
(click)="
439+
trainrunSectionTimesService.onNodeLeftDepartureTimeButtonPlus();
440+
stopPropagation($event)
441+
"
426442
>
427443
+
428444
</button>
@@ -463,7 +479,9 @@
463479
height="25px"
464480
width="25px"
465481
aria-hidden="false"
466-
(click)="trainrunSectionTimesService.onButtonTravelTimeLock()"
482+
(click)="
483+
trainrunSectionTimesService.onButtonTravelTimeLock(); stopPropagation($event)
484+
"
467485
title="Fahrzeit 'lock'"
468486
>
469487
</sbb-icon>
@@ -474,7 +492,9 @@
474492
height="25px"
475493
width="25px"
476494
aria-hidden="false"
477-
(click)="trainrunSectionTimesService.onButtonTravelTimeLock()"
495+
(click)="
496+
trainrunSectionTimesService.onButtonTravelTimeLock(); stopPropagation($event)
497+
"
478498
title="Fahrzeit 'lock' entfernen"
479499
>
480500
</sbb-icon>
@@ -492,7 +512,9 @@
492512
tabindex="-1"
493513
mode="ghost"
494514
class="ButtonMinus"
495-
(click)="trainrunSectionTimesService.onTravelTimeButtonMinus()"
515+
(click)="
516+
trainrunSectionTimesService.onTravelTimeButtonMinus(); stopPropagation($event)
517+
"
496518
>
497519
-
498520
</button>
@@ -515,7 +537,9 @@
515537
tabindex="-1"
516538
mode="ghost"
517539
class="ButtonPlus"
518-
(click)="trainrunSectionTimesService.onTravelTimeButtonPlus()"
540+
(click)="
541+
trainrunSectionTimesService.onTravelTimeButtonPlus(); stopPropagation($event)
542+
"
519543
>
520544
+
521545
</button>
@@ -531,7 +555,10 @@
531555
tabindex="-1"
532556
mode="ghost"
533557
class="ButtonMinus"
534-
(click)="trainrunSectionTimesService.onBottomTravelTimeButtonMinus()"
558+
(click)="
559+
trainrunSectionTimesService.onBottomTravelTimeButtonMinus();
560+
stopPropagation($event)
561+
"
535562
>
536563
-
537564
</button>
@@ -554,7 +581,10 @@
554581
tabindex="-1"
555582
mode="ghost"
556583
class="ButtonPlus"
557-
(click)="trainrunSectionTimesService.onBottomTravelTimeButtonPlus()"
584+
(click)="
585+
trainrunSectionTimesService.onBottomTravelTimeButtonPlus();
586+
stopPropagation($event)
587+
"
558588
>
559589
+
560590
</button>
@@ -573,7 +603,10 @@
573603
tabindex="-1"
574604
mode="ghost"
575605
class="ButtonMinus"
576-
(click)="trainrunSectionTimesService.onNodeRightDepartureTimeButtonMinus()"
606+
(click)="
607+
trainrunSectionTimesService.onNodeRightDepartureTimeButtonMinus();
608+
stopPropagation($event)
609+
"
577610
>
578611
-
579612
</button>
@@ -596,7 +629,10 @@
596629
tabindex="-1"
597630
mode="ghost"
598631
class="ButtonPlus"
599-
(click)="trainrunSectionTimesService.onNodeRightDepartureTimeButtonPlus()"
632+
(click)="
633+
trainrunSectionTimesService.onNodeRightDepartureTimeButtonPlus();
634+
stopPropagation($event)
635+
"
600636
>
601637
+
602638
</button>
@@ -621,7 +657,9 @@
621657
height="25px"
622658
width="25px"
623659
aria-hidden="false"
624-
(click)="trainrunSectionTimesService.onButtonNodeRightLock()"
660+
(click)="
661+
trainrunSectionTimesService.onButtonNodeRightLock(); stopPropagation($event)
662+
"
625663
title="Ab-/Ankunftszeit 'lock'"
626664
>
627665
</sbb-icon>
@@ -632,7 +670,9 @@
632670
height="25px"
633671
width="25px"
634672
aria-hidden="false"
635-
(click)="trainrunSectionTimesService.onButtonNodeRightLock()"
673+
(click)="
674+
trainrunSectionTimesService.onButtonNodeRightLock(); stopPropagation($event)
675+
"
636676
title="Ab-/Ankunftszeit 'lock' entfernen"
637677
>
638678
</sbb-icon>
@@ -651,7 +691,10 @@
651691
tabindex="-1"
652692
mode="ghost"
653693
class="ButtonMinus"
654-
(click)="trainrunSectionTimesService.onNodeRightArrivalTimeButtonMinus()"
694+
(click)="
695+
trainrunSectionTimesService.onNodeRightArrivalTimeButtonMinus();
696+
stopPropagation($event)
697+
"
655698
>
656699
-
657700
</button>
@@ -674,7 +717,10 @@
674717
tabindex="-1"
675718
mode="ghost"
676719
class="ButtonPlus"
677-
(click)="trainrunSectionTimesService.onNodeRightArrivalTimeButtonPlus()"
720+
(click)="
721+
trainrunSectionTimesService.onNodeRightArrivalTimeButtonPlus();
722+
stopPropagation($event)
723+
"
678724
>
679725
+
680726
</button>
@@ -712,7 +758,10 @@
712758
class="FunctionButton Rotation90"
713759
tabindex="-1"
714760
mode="icon"
715-
(click)="trainrunSectionTimesService.onPropagateTimeLeft(trainrunSection, true)"
761+
(click)="
762+
trainrunSectionTimesService.onPropagateTimeLeft(trainrunSection, true);
763+
stopPropagation($event)
764+
"
716765
[title]="'app.perlenkette.perlenkette-section.propagate-times-upwards' | translate"
717766
>
718767
<div>
@@ -729,7 +778,10 @@
729778
class="FunctionButton Rotation90"
730779
tabindex="-1"
731780
mode="icon"
732-
(click)="trainrunSectionTimesService.onPropagateTimeRight(trainrunSection, true)"
781+
(click)="
782+
trainrunSectionTimesService.onPropagateTimeRight(trainrunSection, true);
783+
stopPropagation($event)
784+
"
733785
[title]="'app.perlenkette.perlenkette-section.propagate-times-downwards' | translate"
734786
>
735787
<div>
@@ -840,7 +892,7 @@
840892
tabindex="-1"
841893
mode="ghost"
842894
class="ButtonMinus"
843-
(click)="onInputNbrStopsElementButtonMinus($event)"
895+
(click)="onInputNbrStopsElementButtonMinus($event); stopPropagation($event)"
844896
>
845897
-
846898
</button>
@@ -854,7 +906,7 @@
854906
sbbInput
855907
spellcheck="false"
856908
pattern="^[0-9]*"
857-
[(ngModel)]="numberOfStops"
909+
[(ngModel)]="perlenketteSection.numberOfStops"
858910
(change)="onInputNbrStopsChanged()"
859911
/>
860912
</div>
@@ -863,7 +915,7 @@
863915
tabindex="-1"
864916
mode="ghost"
865917
class="ButtonPlus"
866-
(click)="onInputNbrStopsElementButtonPlus($event)"
918+
(click)="onInputNbrStopsElementButtonPlus($event); stopPropagation($event)"
867919
>
868920
+
869921
</button>

src/app/perlenkette/perlenkette-section/perlenkette-section.component.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@ export class PerlenketteSectionComponent implements OnInit, AfterContentInit, On
9696
}
9797

9898
ngOnInit() {
99+
this.numberOfStops = this.perlenketteSection.numberOfStops;
99100
this.stationNumberArray = Array(this.perlenketteSection.numberOfStops)
100101
.fill(1)
101102
.map((x, i) => i + 1);

0 commit comments

Comments
 (0)