JAVASCRIPT   99

dom.js

Guest on 29th July 2021 03:18:03 PM

  1. import * as dom from '../utils/dom/index'
  2.  
  3. export {
  4.   getContainer,
  5.   getPopup,
  6.   getTitle,
  7.   getContent,
  8.   getImage,
  9.   getIcons,
  10.   getCloseButton,
  11.   getButtonsWrapper,
  12.   getActions,
  13.   getConfirmButton,
  14.   getCancelButton,
  15.   getFooter,
  16.   getFocusableElements,
  17.   getValidationMessage,
  18.   isLoading
  19. } from '../utils/dom/index'
  20.  
  21. /*
  22.  * Global function to determine if swal2 popup is shown
  23.  */
  24. export const isVisible = () => {
  25.   return !!dom.getPopup()
  26. }
  27.  
  28. /*
  29.  * Global function to click 'Confirm' button
  30.  */
  31. export const clickConfirm = () => dom.getConfirmButton().click()
  32.  
  33. /*
  34.  * Global function to click 'Cancel' button
  35.  */
  36. export const clickCancel = () => dom.getCancelButton().click()

Raw Paste


Login or Register to edit or fork this paste. It's free.