Skip to content

Commit ac28d14

Browse files
author
Robert Mosolgo
authored
Merge pull request #708 from glosie/master
check for turbolinks classic before teardown
2 parents 6642ae0 + b1ee8ef commit ac28d14

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

react_ujs/src/events/detect.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,9 @@ var turbolinksClassicEvents = require("./turbolinksClassic")
99
module.exports = function(ujs) {
1010
if (ujs.handleEvent) {
1111
// We're calling this a second time -- remove previous handlers
12-
turbolinksClassicEvents.teardown(ujs)
12+
if (typeof Turbolinks.EVENTS !== "undefined") {
13+
turbolinksClassicEvents.teardown(ujs);
14+
}
1315
turbolinksEvents.teardown(ujs);
1416
turbolinksClassicDeprecatedEvents.teardown(ujs);
1517
pjaxEvents.teardown(ujs);

0 commit comments

Comments
 (0)