All Downloads are FREE. Search and download functionalities are using the official Maven repository.

package.src.utils.dom.renderers.renderCloseButton.js Maven / Gradle / Ivy

Go to download

A beautiful, responsive, customizable and accessible (WAI-ARIA) replacement for JavaScript's popup boxes, supported fork of sweetalert

The newest version!
import * as dom from '../../dom/index.js'

/**
 * @param {SweetAlert} instance
 * @param {SweetAlertOptions} params
 */
export const renderCloseButton = (instance, params) => {
  const closeButton = dom.getCloseButton()
  if (!closeButton) {
    return
  }

  dom.setInnerHtml(closeButton, params.closeButtonHtml || '')

  // Custom class
  dom.applyCustomClass(closeButton, params, 'closeButton')

  dom.toggle(closeButton, params.showCloseButton)
  closeButton.setAttribute('aria-label', params.closeButtonAriaLabel || '')
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy