Sha256: fd0b312d2d2a9f4eb7f5226409c9972c501656d376a70b99c109beb660ce498c
Contents?: true
Size: 1.05 KB
Versions: 16
Compression:
Stored size: 1.05 KB
Contents
/* global Swal */ document.addEventListener("spree:load", function() { const infoToggle = document.querySelectorAll('[data-show-info]') infoToggle.forEach(function(infoElem) { infoElem.addEventListener('click', function() { const alertType = infoElem.dataset.alertKind const alertTitle = infoElem.dataset.alertTitle const alertHtml = infoElem.dataset.alertHtml const alertMessage = infoElem.dataset.alertMessage showInfoAlert(alertType, alertTitle, alertMessage, alertHtml) }) }) }) // eslint-disable-next-line no-unused-vars function showInfoAlert(type = null, title = null, message = null, html = null) { const infoAlert = Swal.mixin({ showConfirmButton: false, showCloseButton: true, timer: null, timerProgressBar: false, showClass: { popup: 'animate__animated animate__fadeInUp animate__faster' }, hideClass: { popup: 'animate__animated animate__fadeOutDown animate__faster' } }) infoAlert.fire({ icon: type, title: title, text: message, html: html }) }
Version data entries
16 entries across 16 versions & 1 rubygems