overleaf/services/web/frontend/js/features/utils/swapModal.js
Jakob Ackermann 59d83c4b88 Merge pull request #5117 from overleaf/jpa-plans-de-ng
[web] de-ng plans page

GitOrigin-RevId: b902b10b45ab3fd46e71545c94f65e8f079c4564
2021-09-23 08:03:23 +00:00

12 lines
388 B
JavaScript

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')
}