|
|
@ -3,6 +3,8 @@ import Toastify from 'toastify-js' |
|
|
|
|
|
|
|
export default class extends Controller { |
|
|
|
|
|
|
|
static targets = ['flashItem'] |
|
|
|
|
|
|
|
OPTIONS = { |
|
|
|
selector: 'flashbar', |
|
|
|
escapeMarkup: false, |
|
|
@ -11,6 +13,12 @@ export default class extends Controller { |
|
|
|
offset: { y: 30 }, |
|
|
|
} |
|
|
|
|
|
|
|
onLoad(event) { |
|
|
|
this.flashItemTargets.forEach((item) => { |
|
|
|
this.popup({ detail: { type: item.dataset.type, message: item.textContent.trim() } }) |
|
|
|
}) |
|
|
|
} |
|
|
|
|
|
|
|
icon(drawing) { |
|
|
|
return `<svg xmlns="http://www.w3.org/2000/svg" class="h-6 w-6 shrink-0 stroke-current mx-4" fill="none" viewBox="0 0 24 24">
|
|
|
|
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="${drawing}" /> |
|
|
|