Improved cleanup on Turbolinks navigation

This commit is contained in:
Jonathan Abbett 2021-04-20 14:59:45 -04:00
parent 8663c2ed6c
commit 3d21f3a092

View File

@ -22,4 +22,7 @@ document.addEventListener("turbolinks:load", Abraham.startNextIncompleteTour);
document.addEventListener('turbolinks:before-cache', function() {
// Remove visible product tours
document.querySelectorAll(".shepherd-element").forEach(function(el) { el.remove() });
// Clear Abraham data
Abraham.tours = {};
Abraham.incompleteTours = [];
});