Skip to content

Commit

Permalink
Fix Alpine.js error
Browse files Browse the repository at this point in the history
  • Loading branch information
rhiannonjourney committed Feb 27, 2024
1 parent f3dcb71 commit 04aeafb
Showing 1 changed file with 47 additions and 46 deletions.
93 changes: 47 additions & 46 deletions resources/views/forms/components/resource-picker/modal.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -91,56 +91,57 @@
$resourceLabel = $resource::getModelLabel();
@endphp

<x-filament::modal
width="full"
:id="$configuration->getModalId()"
x-data="{ statePath: null }"
x-on:open-modal.window="
if ($event.detail.id !== '{{ $configuration->getModalId() }}') {
return
}
<div x-data="{ statePath: null }">
<x-filament::modal
width="full"
:id="$configuration->getModalId()"
x-on:open-modal.window="
if ($event.detail.id !== '{{ $configuration->getModalId() }}') {
return
}
statePath = $event.detail.getStatePath
$store.resourceBrowser.initResourceFromEvent('{{ $configuration->getAlpineStoreId() }}', $event.detail)
open()
"
>
<div>
<div class="relative h-full max-h-[80vh] overflow-y-scroll">
<livewire:resource-picker::resource-browser
:defer="true"
:resource="$configuration->resource"
:wire:key="$configuration->getResourceId().'-resource-picker'"
/>
statePath = $event.detail.getStatePath
$store.resourceBrowser.initResourceFromEvent('{{ $configuration->getAlpineStoreId() }}', $event.detail)
open()
"
>
<div>
<div class="relative h-full max-h-[80vh] overflow-y-scroll">
<livewire:resource-picker::resource-browser
:defer="true"
:resource="$configuration->resource"
:wire:key="$configuration->getResourceId().'-resource-picker'"
/>
</div>
</div>
</div>

<x-slot name="footer">
<div
@class([
'flex space-x-2',
'justify-start' => config('filament.layout.forms.actions.alignment') === 'left',
'justify-center' => config('filament.layout.forms.actions.alignment') === 'center',
'justify-end' => config('filament.layout.forms.actions.alignment') === 'right',
])
>
<x-filament::button
outlined
color="gray"
x-on:click="$dispatch('close-modal', {id: '{{ $configuration->getModalId() }}'})"
>
Cancel
</x-filament::button>

<x-filament::button
x-on:click="$dispatch('close-modal', {id: '{{ $configuration->getModalId() }}', statePath: statePath})"
<x-slot name="footer">
<div
@class([
'flex space-x-2',
'justify-start' => config('filament.layout.forms.actions.alignment') === 'left',
'justify-center' => config('filament.layout.forms.actions.alignment') === 'center',
'justify-end' => config('filament.layout.forms.actions.alignment') === 'right',
])
>
Update and Close
</x-filament::button>
</div>
</x-slot>
</x-filament::modal>
<x-filament::button
outlined
color="gray"
x-on:click="$dispatch('close-modal', {id: '{{ $configuration->getModalId() }}'})"
>
Cancel
</x-filament::button>

<x-filament::button
x-on:click="$dispatch('close-modal', {id: '{{ $configuration->getModalId() }}', statePath: statePath})"
>
Update and Close
</x-filament::button>
</div>
</x-slot>
</x-filament::modal>
</div>
@endforeach
</div>
@endonce

0 comments on commit 04aeafb

Please sign in to comment.