diff --git a/resources/views/kanban-scripts.blade.php b/resources/views/kanban-scripts.blade.php index b4c0c78..da1ab8b 100644 --- a/resources/views/kanban-scripts.blade.php +++ b/resources/views/kanban-scripts.blade.php @@ -20,7 +20,7 @@ function onUpdate(e) { Livewire.dispatch('sort-changed', {recordId, status, orderedIds}) } - window.onload = () => { + document.addEventListener('livewire:navigated', () => { @foreach($statuses as $status) {{-- dont touch this line --}} Sortable.create(document.getElementById('{{ $status['id'] }}'), { @@ -34,5 +34,5 @@ function onUpdate(e) { onAdd, }) @endforeach - } + })