Skip to content

Commit

Permalink
chore: remove legacy code
Browse files Browse the repository at this point in the history
This were leftovers from the previous versions when we were reusing
the same DOM node for all popups.

Now we're creating the new DOM node (.swal2-container) for each popup.
  • Loading branch information
limonte committed Jul 20, 2019
1 parent 8334ded commit 1cdb9a0
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions src/instanceMethods/_main.js
Original file line number Diff line number Diff line change
Expand Up @@ -149,16 +149,10 @@ const swalPromise = (instance, domCache, innerParams) => {
// Reverse buttons (Confirm on the right side)
if (innerParams.reverseButtons) {
domCache.confirmButton.parentNode.insertBefore(domCache.cancelButton, domCache.confirmButton)
} else {
domCache.confirmButton.parentNode.insertBefore(domCache.confirmButton, domCache.cancelButton)
}

addKeydownHandler(instance, globalState, innerParams, dismissWith)

instance.enableButtons()
instance.hideLoading()
instance.resetValidationMessage()

if (innerParams.toast && (innerParams.input || innerParams.footer || innerParams.showCloseButton)) {
dom.addClass(document.body, swalClasses['toast-column'])
} else {
Expand Down Expand Up @@ -188,7 +182,7 @@ const swalPromise = (instance, domCache, innerParams) => {
}
}

// fix scroll
// Scroll container to top on open (#1247)
domCache.container.scrollTop = 0
})
}
Expand Down

0 comments on commit 1cdb9a0

Please sign in to comment.