Skip to content

Commit

Permalink
Migrates "action-message"
Browse files Browse the repository at this point in the history
  • Loading branch information
nunomaduro committed Aug 17, 2023
1 parent 96685b1 commit e7c7eed
Showing 1 changed file with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
@props(['on'])

<div x-data="{ shown: false, timeout: null }"
x-init="@this.on('{{ $on }}', () => { clearTimeout(timeout); shown = true; timeout = setTimeout(() => { shown = false }, 2000); })"
x-show.transition.out.opacity.duration.1500ms="shown"
x-transition:leave.opacity.duration.1500ms
style="display: none;"
x-on:{{ $on }}.window="
clearTimeout(timeout);
shown = true;
timeout = setTimeout(() => { shown = false }, 2000);
"
x-show.transition.out.opacity.duration.1500ms="shown"
x-transition:leave.opacity.duration.1500ms
style="display: none;"
{{ $attributes->merge(['class' => 'text-sm text-gray-600 dark:text-gray-400']) }}>
{{ $slot->isEmpty() ? 'Saved.' : $slot }}
</div>

0 comments on commit e7c7eed

Please sign in to comment.