From 47e802256a0f50f245c63fe11e10a55efc3036ff Mon Sep 17 00:00:00 2001 From: Tom Coleman Date: Mon, 15 Oct 2012 11:55:28 +1100 Subject: [PATCH] Open in new tabs on ctrl click etc. Fixes #12 --- app/client/display.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/client/display.js b/app/client/display.js index ff7b56c..c609301 100644 --- a/app/client/display.js +++ b/app/client/display.js @@ -57,7 +57,6 @@ }); // redraw a template every X seconds - // Nice trick huh? I should put something like this in deps-extensions - T Handlebars.registerHelper('refreshEvery', function(seconds) { var ctx = Meteor.deps.Context.current; if (!ctx) @@ -107,6 +106,8 @@ Template.header.events = { 'click .page-header a': function(e) { + if (e.shiftKey || e.ctrlKey || e.metaKey) return true; + e.preventDefault(); Router.navigate('/', { trigger: true }); } @@ -114,6 +115,8 @@ Template.content.events = { 'click a.nav-link': function(e) { + if (e.shiftKey || e.ctrlKey || e.metaKey) return true; + e.preventDefault(); var path = $(e.target).attr('href') || ''; Router.navigate(path, { trigger: true });