From f0cbf2ac7318b175ab2a462c7e14e5395a4122be Mon Sep 17 00:00:00 2001 From: "Joseph.Rawlings" Date: Wed, 3 Dec 2025 23:53:19 -0500 Subject: [PATCH] refactor: simplify onboarding modal initialization and enhance slide navigation functionality for improved user experience --- .../resources/views/modal.blade.php | 121 +++++++----------- 1 file changed, 44 insertions(+), 77 deletions(-) diff --git a/extensions/Others/Onboarding/resources/views/modal.blade.php b/extensions/Others/Onboarding/resources/views/modal.blade.php index ada00b671..dd723633c 100644 --- a/extensions/Others/Onboarding/resources/views/modal.blade.php +++ b/extensions/Others/Onboarding/resources/views/modal.blade.php @@ -10,24 +10,62 @@ @if($showModal)
getId()), - showBackdrop: @js($this->showBackdrop ?? false) - })" - x-init="init()"> + showBackdrop: @js($this->showBackdrop ?? false), + init() { + console.log('🚀 Alpine Init - Direct Data'); + console.log('Slides:', this.slides); + console.log('Current Slide:', this.currentSlide); + console.log('Slides Length:', this.slides?.length); + + this.$watch('open', value => { + document.documentElement.style.overflow = value ? 'hidden' : ''; + }); + if (this.open) { + document.documentElement.style.overflow = 'hidden'; + } + }, + get activeSlide() { + return this.slides[this.currentSlide] ?? null; + }, + primaryActionLabel(index) { + const isLast = index === this.slides.length - 1; + if (isLast) return 'Finish'; + return (this.slides[index]?.is_guided ?? false) ? 'Continue' : 'Next'; + }, + previous() { + if (this.currentSlide <= 0) return; + this.currentSlide--; + @this.call('previousSlide'); + }, + next() { + if (this.currentSlide >= this.slides.length - 1) { + this.finish(); + return; + } + this.currentSlide++; + @this.call('nextSlide'); + }, + finish() { + @this.call('finish'); + } + }"
- @once - - @endonce @endif