overleaf/services/web/frontend/js/features/utils/swapModal.js

13 lines
388 B
JavaScript
Raw Normal View History

export function swapModal(selectorBefore, selectorAfter) {
const modalBefore = $(selectorBefore)
const modalAfter = $(selectorAfter)
// Disable the fade-out + fade-in animation when swapping the forms.
modalBefore.removeClass('fade')
modalAfter.removeClass('fade')
modalAfter.modal()
modalBefore.modal('hide')
modalBefore.addClass('fade')
modalAfter.addClass('fade')
}