Advertisement
Guest User

Untitled

a guest
Mar 20th, 2019
51
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.72 KB | None | 0 0
  1. export default function ($f7, reopenPopup = true) {
  2. if (module.hot) {
  3. module.hot.addStatusHandler(status => {
  4. if (status === 'idle') {
  5. const activePopup = document.querySelector('.modal-in')
  6.  
  7. // next tick
  8. setTimeout(() => {
  9. // remove all popup backdrops if all popups are closed
  10. if (!document.querySelectorAll('.modal-in').length) {
  11. const popupBackdrop = document.querySelector('.popup-backdrop')
  12. if (popupBackdrop) {
  13. popupBackdrop.classList.remove('backdrop-in')
  14. }
  15.  
  16. if (reopenPopup && activePopup.id) {
  17. $f7.popup.open(`#${activePopup.id}`, false)
  18. }
  19. }
  20. }, 0)
  21. }
  22. })
  23. }
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement