Skip to content

Commit 7e62285

Browse files
authored
Merge pull request #1001 from sergioalcaraz/fix_turbo_undefined
Fix: When determining whether Turbo exists it throws undefined
2 parents 69d9931 + 15f82df commit 7e62285

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

webroot/js/inject-iframe.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ if (elem) {
100100
if (!win.debugKitListenersApplied) {
101101
// Add support for turbo DOMContentLoaded alternative
102102
// see https://turbo.hotwired.dev/reference/events#turbo%3Aload
103-
const loadedEvent = Turbo ? 'turbo:load' : 'DOMContentLoaded';
103+
const loadedEvent = typeof Turbo !== 'undefined' && Turbo !== null ? 'turbo:load' : 'DOMContentLoaded';
104104
doc.addEventListener(loadedEvent, onReady, false);
105105
doc.addEventListener(loadedEvent, proxyAjaxOpen, false);
106106
doc.addEventListener(loadedEvent, proxyAjaxSend, false);

0 commit comments

Comments
 (0)