Uncommend not working exit stream animation javascript code
This commit is contained in:
@@ -22,17 +22,17 @@ document.addEventListener("turbo:before-stream-render", function(event) {
|
||||
|
||||
// Add a class to an element we are about to remove from the page
|
||||
// as defined by its "data-stream-exit-class"
|
||||
var elementToRemove = document.getElementById(event.target.target)
|
||||
if (elementToRemove) {
|
||||
var streamExitClass = elementToRemove.dataset.streamExitClass
|
||||
if (streamExitClass) {
|
||||
// Intercept the removal of the element
|
||||
event.preventDefault()
|
||||
elementToRemove.classList.add(streamExitClass)
|
||||
// Wait for its animation to end before removing the element
|
||||
elementToRemove.addEventListener("animationend", function() {
|
||||
event.target.performAction()
|
||||
})
|
||||
}
|
||||
}
|
||||
// var elementToRemove = document.getElementById(event.target.target)
|
||||
// if (elementToRemove) {
|
||||
// var streamExitClass = elementToRemove.dataset.streamExitClass
|
||||
// if (streamExitClass) {
|
||||
// // Intercept the removal of the element
|
||||
// event.preventDefault()
|
||||
// elementToRemove.classList.add(streamExitClass)
|
||||
// // Wait for its animation to end before removing the element
|
||||
// elementToRemove.addEventListener("animationend", function() {
|
||||
// event.target.performAction()
|
||||
// })
|
||||
// }
|
||||
// }
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user