UNPKG

cheetah-framework

Version:

Cheetah Framework JS used in all our applications

23 lines (19 loc) 416 B
let modalOpened = false export default class ModalHelper { static openModal (modal) { if (modalOpened) { return } modal.$on('close', () => { this.closeModal(modal) }) modal.$mount() document.body.appendChild(modal.$el) modalOpened = true } static closeModal (modal) { modal.$destroy() modal.$el.parentNode.removeChild(modal.$el) modalOpened = false } }