|
|
@ -1,13 +1,14 @@ |
|
|
|
<h2>NOTIFICATION BAR</h2> |
|
|
|
<script data-turbo-temporary> |
|
|
|
document.addEventListener('turbo:load',(e)=>{ |
|
|
|
<% if flash.count.positive? %> |
|
|
|
<script data-turbo-temporary> |
|
|
|
document.addEventListener('turbo:load',(e)=>{ |
|
|
|
|
|
|
|
const notyf=window.buildNotyf() |
|
|
|
notyf.success('rails notice') |
|
|
|
notyf.error('rails alert') |
|
|
|
const notyf=new Notyf({ duration: 5000, position: { x: 'center', y: 'top' } }) |
|
|
|
<% if flash.notice%> notyf.success('<%=flash.notice%>') <%end%> |
|
|
|
<% if flash.alert%> notyf.error('<%=flash.alert%>') <%end%> |
|
|
|
|
|
|
|
// useful to prevent flickering from turbo preview |
|
|
|
Turbo.cache.exemptPageFromPreview() |
|
|
|
// useful to prevent flickering from turbo preview |
|
|
|
Turbo.cache.exemptPageFromPreview() |
|
|
|
|
|
|
|
}, {once: true}) |
|
|
|
</script> |
|
|
|
}, {once: true}) |
|
|
|
</script> |
|
|
|
<%end%> |