![]() Server : Apache System : Linux server2.corals.io 4.18.0-348.2.1.el8_5.x86_64 #1 SMP Mon Nov 15 09:17:08 EST 2021 x86_64 User : corals ( 1002) PHP Version : 7.4.33 Disable Function : exec,passthru,shell_exec,system Directory : /home/corals/ts.corals.io/frontend/node_modules/sweetalert2/src/utils/dom/renderers/ |
import { swalClasses, iconTypes } from '../../classes.js' import { error } from '../../utils.js' import * as dom from '../../dom/index' import sweetAlert from '../../../sweetalert2' export const renderIcon = (params) => { const icons = dom.getIcons() for (let i = 0; i < icons.length; i++) { dom.hide(icons[i]) } if (params.type) { if (Object.keys(iconTypes).indexOf(params.type) !== -1) { const icon = sweetAlert.getPopup().querySelector(`.${swalClasses.icon}.${iconTypes[params.type]}`) dom.show(icon) // Animate icon if (params.animation) { dom.addClass(icon, `swal2-animate-${params.type}-icon`) } } else { error(`Unknown type! Expected "success", "error", "warning", "info" or "question", got "${params.type}"`) } } }