sweetalert2
Version:
A beautiful, responsive, customizable and accessible (WAI-ARIA) replacement for JavaScript's popup boxes, supported fork of sweetalert
28 lines (21 loc) • 551 B
JavaScript
import * as dom from '../../dom/index.js'
/**
* @param {SweetAlert} instance
* @param {SweetAlertOptions} params
*/
export const renderTitle = (instance, params) => {
const title = dom.getTitle()
if (!title) {
return
}
dom.showWhenInnerHtmlPresent(title)
dom.toggle(title, params.title || params.titleText, 'block')
if (params.title) {
dom.parseHtmlToContainer(params.title, title)
}
if (params.titleText) {
title.innerText = params.titleText
}
// Custom class
dom.applyCustomClass(title, params, 'title')
}