diff --git a/app/Routes/Routes.js b/app/Routes/Routes.js index b6803480..bdd7913c 100644 --- a/app/Routes/Routes.js +++ b/app/Routes/Routes.js @@ -13,6 +13,17 @@ Router.plugin("ensureSignedIn", { ] }); +if (Meteor.isClient){ + document.addEventListener(`click`, e => { + const origin = e.target.closest("a"); + + if (origin && Router.findFirstRoute(origin.href)) { + Router.go(origin.href); + e.preventDefault(); + } +}); +} + Router.plugin("dataNotFound", {notFoundTemplate: "notFound"}); var handleSubError = function(e){