Something went wrong. Try again.
[READ-ONLY] Mirror of https://github.com/glacials/splits-io. a speedrunning data store and analysis engine splits.io
Something went wrong. Try again.
123456789101112131415161718192021222324252627282930313233const setRoutesOnly = function(routesOnly) { Array.from(document.getElementById('export-menu').getElementsByClassName('can-strip-history')).forEach((el) => { if (routesOnly) { el.href = el.href + '?blank=1' el.href = `${el.href.split('?')[0]}?${el.href.split('?')[1]}` // Make sure we don't have 2x ?blank=1 due to bugs } else { el.href = el.href.split('?')[0] } })}
document.addEventListener('turbolinks:load', () => { const checkbox = document.getElementById('route-check') if (checkbox === null) { return }
setRoutesOnly(checkbox.checked)
// Stop clicks on the checkbox's label text from closing the dropdown menu document.getElementById('route-check-label').addEventListener('click', (event) => { event.stopPropagation() })})
// We can't attach an event listener directly to the element inside a turbolinks:load event.// See https://github.com/turbolinks/turbolinks#observing-navigation-eventsdocument.addEventListener('click', event => { if (event.target.matches('#route-check')) { setRoutesOnly(event.target.checked) }})