Comparing version 2.1.0 to 2.2.0
@@ -122,3 +122,5 @@ (function webpackUniversalModuleDefinition(root, factory) { | ||
// We're calling this a second time -- remove previous handlers | ||
turbolinksClassicEvents.teardown(ujs) | ||
if (typeof Turbolinks.EVENTS !== "undefined") { | ||
turbolinksClassicEvents.teardown(ujs); | ||
} | ||
turbolinksEvents.teardown(ujs); | ||
@@ -189,5 +191,10 @@ turbolinksClassicDeprecatedEvents.teardown(ujs); | ||
component = fromCtx(className) | ||
} catch (err) { | ||
} catch (firstErr) { | ||
// fallback to global: | ||
component = fromGlobal(className) | ||
try { | ||
component = fromGlobal(className) | ||
} catch (secondErr) { | ||
console.error(firstErr) | ||
console.error(secondErr) | ||
} | ||
} | ||
@@ -194,0 +201,0 @@ return component |
{ | ||
"name": "react_ujs", | ||
"version": "2.1.0", | ||
"version": "2.2.0", | ||
"description": "Rails UJS for the react-rails gem", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -12,3 +12,5 @@ var nativeEvents = require("./native") | ||
// We're calling this a second time -- remove previous handlers | ||
turbolinksClassicEvents.teardown(ujs) | ||
if (typeof Turbolinks.EVENTS !== "undefined") { | ||
turbolinksClassicEvents.teardown(ujs); | ||
} | ||
turbolinksEvents.teardown(ujs); | ||
@@ -15,0 +17,0 @@ turbolinksClassicDeprecatedEvents.teardown(ujs); |
@@ -14,5 +14,10 @@ // Make a function which: | ||
component = fromCtx(className) | ||
} catch (err) { | ||
} catch (firstErr) { | ||
// fallback to global: | ||
component = fromGlobal(className) | ||
try { | ||
component = fromGlobal(className) | ||
} catch (secondErr) { | ||
console.error(firstErr) | ||
console.error(secondErr) | ||
} | ||
} | ||
@@ -19,0 +24,0 @@ return component |
Sorry, the diff of this file is not supported yet
88363
794