Fixed: ctrl + clicking links will open in a new tab

This commit is contained in:
Mark McDowall 2014-10-24 16:54:02 -07:00
parent 2711cd6afa
commit b538b450f5
1 changed files with 8 additions and 2 deletions

View File

@ -49,9 +49,15 @@ define(
} }
if (!href.startsWith('http')) { if (!href.startsWith('http')) {
var relativeHref = href.replace(StatusModel.get('urlBase'), ''); if (event.ctrlKey) {
window.open(href, '_blank');
}
Backbone.history.navigate(relativeHref, { trigger: true }); else {
var relativeHref = href.replace(StatusModel.get('urlBase'), '');
Backbone.history.navigate(relativeHref, { trigger: true });
}
} }
else if (href.contains('#')) { else if (href.contains('#')) {
//Open in new tab without dereferer (since it doesn't support fragments) //Open in new tab without dereferer (since it doesn't support fragments)