From b538b450f505c157ede0c1b5b105a45edfedb4e2 Mon Sep 17 00:00:00 2001 From: Mark McDowall Date: Fri, 24 Oct 2014 16:54:02 -0700 Subject: [PATCH] Fixed: ctrl + clicking links will open in a new tab --- src/UI/jQuery/RouteBinder.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/UI/jQuery/RouteBinder.js b/src/UI/jQuery/RouteBinder.js index e3e85c068..34918b78d 100644 --- a/src/UI/jQuery/RouteBinder.js +++ b/src/UI/jQuery/RouteBinder.js @@ -49,9 +49,15 @@ define( } if (!href.startsWith('http')) { - var relativeHref = href.replace(StatusModel.get('urlBase'), ''); + if (event.ctrlKey) { + window.open(href, '_blank'); + } + + else { + var relativeHref = href.replace(StatusModel.get('urlBase'), ''); - Backbone.history.navigate(relativeHref, { trigger: true }); + Backbone.history.navigate(relativeHref, { trigger: true }); + } } else if (href.contains('#')) { //Open in new tab without dereferer (since it doesn't support fragments)