Sha256: cc359ea22cb9d859794a28b2a2fea91e7ea3ddd2f14836e21e0106b6487e118a
Contents?: true
Size: 879 Bytes
Versions: 50
Compression:
Stored size: 879 Bytes
Contents
// Monkeypatch to fix turbo issue of wrong turbo-frame // See: https://github.com/hotwired/turbo/pull/579 document.addEventListener("turbo:before-fetch-request", (event) => { const targetTurboFrame = event.target.getAttribute("data-turbo-frame"); const fetchTurboFrame = event.detail.fetchOptions.headers["Turbo-Frame"]; if ( targetTurboFrame && targetTurboFrame != fetchTurboFrame && document.querySelector(`turbo-frame#${targetTurboFrame}`) ) { event.detail.fetchOptions.headers["Turbo-Frame"] = targetTurboFrame; } }); // // Reload the entire page if we are missing a frame // // See: https://stackoverflow.com/a/75704489/644571 // document.addEventListener("turbo:frame-missing", (event) => { // if (event.target.id != 'modal') return // const { detail: { response, visit } } = event; // event.preventDefault(); // visit(response); // });
Version data entries
50 entries across 50 versions & 1 rubygems