From fee25d4cb45084f412c8b8113e78a5a270e4192d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Munsch?= Date: Wed, 6 Dec 2023 16:07:41 +0100 Subject: [PATCH] Win proof form fix --- ts/pages/won.ts | 9 +++++++-- views/pages/participation/parts/winning-proof.blade.php | 7 ++++--- views/pages/participation/won.blade.php | 2 +- 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/ts/pages/won.ts b/ts/pages/won.ts index 7113005..7967bb4 100644 --- a/ts/pages/won.ts +++ b/ts/pages/won.ts @@ -6,14 +6,15 @@ document.addEventListener("DOMContentLoaded", function () { const wheelWrapper = document.getElementById("wheel-wrapper"), spinWheelInner = wheelWrapper?.querySelector(".wheel-inner") as HTMLElement | null | undefined, spinWheelBtnList = wheelWrapper?.querySelectorAll(".wheel-spin") as NodeListOf | undefined, + animationSection = document.getElementById("spin-animation"), prizeSection = document.getElementById("prize-section"), discountSection = document.getElementById("discount-section"), winningProofSection = document.getElementById("winning-proof-section"); /** Hide animation and show win sections */ const toggleAnimationPhase = () => { - if (wheelWrapper) { - wheelWrapper.classList.add("d-none"); + if (animationSection) { + animationSection.classList.add("d-none"); } if (prizeSection) { prizeSection.classList.remove("d-none"); @@ -27,6 +28,10 @@ document.addEventListener("DOMContentLoaded", function () { } }; + if (!animationSection) { + throw Error("section#spin-animation missing"); + } + if (wheelWrapper && spinWheelInner && spinWheelBtnList && spinWheelBtnList.length) { let clicks: number = 0; // * Set default degree (360*5) soit 5 tours diff --git a/views/pages/participation/parts/winning-proof.blade.php b/views/pages/participation/parts/winning-proof.blade.php index fad4626..f9f09bc 100644 --- a/views/pages/participation/parts/winning-proof.blade.php +++ b/views/pages/participation/parts/winning-proof.blade.php @@ -16,7 +16,7 @@
-
@method('PUT') @csrf @@ -26,7 +26,8 @@
- +
@@ -34,7 +35,7 @@ {{ __('*Champs obligatoires') }}
-
+
diff --git a/views/pages/participation/won.blade.php b/views/pages/participation/won.blade.php index 1dd22de..183a614 100644 --- a/views/pages/participation/won.blade.php +++ b/views/pages/participation/won.blade.php @@ -18,7 +18,7 @@ @include('theme::pages.participation.parts.prize', [ 'sectionId' => 'prize-section', 'prizeModel' => $prizeModel, - 'winProofAnchor' => 'winproof', + 'winProofAnchor' => 'winning-proof-section', ]) @elseif (!empty($discount)) {{-- COUPON --}}