12 lines
499 B
JavaScript
12 lines
499 B
JavaScript
// resources/js/plugins/GlassToastra/livewire-adapter.js
|
|
import { showToast } from '../../ui/toast';
|
|
|
|
document.addEventListener('livewire:init', () => {
|
|
window.addEventListener('toast', (e) => showToast(e?.detail || {}));
|
|
window.addEventListener('toast.update', (e) => showToast(e?.detail || {})); // gleiche id => ersetzt Karte
|
|
window.addEventListener('toast.clear', (e) => window.toastraGlass?.clear(e?.detail?.position));
|
|
});
|
|
|
|
// optional global
|
|
window.showToast = showToast;
|