From 5dd64a03fc6b62e06839ed588051fd7689ccc331 Mon Sep 17 00:00:00 2001 From: Derek Holloway Date: Fri, 25 Jul 2025 22:25:50 -0700 Subject: [PATCH] Fix checkbox breaking UI --- .../pages/main/jobs/new/jobnew.component.ts | 27 +++++++------------ 1 file changed, 9 insertions(+), 18 deletions(-) diff --git a/src/Client/src/app/pages/main/jobs/new/jobnew.component.ts b/src/Client/src/app/pages/main/jobs/new/jobnew.component.ts index 793424d..62324e2 100644 --- a/src/Client/src/app/pages/main/jobs/new/jobnew.component.ts +++ b/src/Client/src/app/pages/main/jobs/new/jobnew.component.ts @@ -42,6 +42,13 @@ export class JobNewComponent { }; ngAfterViewInit(){ + this.formSteps.changes.subscribe(() => { + this.updateUI(); + }); + this.updateUI(); + } + + updateUI(){ this.formSteps.forEach((step: ElementRef, i: number) => { if (i === this.currentStep) { step.nativeElement.style.left = '0%'; @@ -55,28 +62,12 @@ export class JobNewComponent { nextStep(){ this.currentStep += 1; - this.formSteps.forEach((step: ElementRef, i: number) => { - if (i === this.currentStep) { - step.nativeElement.style.left = '0%'; - } else if (i < this.currentStep) { - step.nativeElement.style.left = '-100%'; - } else { - step.nativeElement.style.left = '100%'; - } - }); + this.updateUI(); } prevStep(){ this.currentStep -= 1; - this.formSteps.forEach((step: ElementRef, i: number) => { - if (i === this.currentStep) { - step.nativeElement.style.left = '0%'; - } else if (i < this.currentStep) { - step.nativeElement.style.left = '-100%'; - } else { - step.nativeElement.style.left = '100%'; - } - }); + this.updateUI(); } PostJobListing(jobListing: JobListing){