You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

appearance.blade.php 1.0KB

12345678910111213141516171819202122232425262728
  1. <x-filament-panels::page style="margin-bottom: 500px">
  2. <x-filament-panels::form wire:submit="save">
  3. {{ $this->form }}
  4. <x-filament-panels::form.actions
  5. :actions="$this->getCachedFormActions()"
  6. :full-width="$this->hasFullWidthFormActions()"
  7. />
  8. </x-filament-panels::form>
  9. </x-filament-panels::page>
  10. <script>
  11. // Save the scroll position before the page is reloaded
  12. document.addEventListener('livewire:init', function () {
  13. Livewire.on('appearanceUpdated', function () {
  14. localStorage.setItem('scrollPosition', window.scrollY.toString());
  15. window.location.reload();
  16. });
  17. });
  18. // Restore the scroll position after the page is reloaded
  19. window.addEventListener('load', function () {
  20. const scrollPosition = parseInt(localStorage.getItem('scrollPosition'), 10);
  21. if (scrollPosition) {
  22. window.scrollTo(0, scrollPosition);
  23. localStorage.removeItem('scrollPosition');
  24. }
  25. });
  26. </script>