You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

29 lines
771 B

3 months ago
8 months ago
8 months ago
8 months ago
4 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
  1. NOTIFICATION
  2. <% if flash.count.positive? %>
  3. <script data-turbo-temporary>
  4. document.addEventListener('turbo:load',(e)=>{
  5. const common={
  6. gravity: 'top',
  7. position: 'center',
  8. duration: 4000,
  9. offset: { y: '1em' },
  10. close: true
  11. }
  12. const notice={ className: 'toastify-notice', ...common }
  13. const alert={ className: 'toastify-alert', ...common }
  14. <% if flash.notice%>
  15. Toastify({ text: '<%=flash.notice%>', ...notice}).showToast();
  16. <%end%>
  17. <% if flash.alert%>
  18. Toastify({ text: '<%=flash.alert%>', ...alert}).showToast();
  19. <%end%>
  20. // useful to prevent flickering from turbo preview
  21. Turbo.cache.exemptPageFromPreview()
  22. }, {once: true})
  23. </script>
  24. <%end%>