Skip to content

Commit

Permalink
fix(history-browser): open link in new tab when it clicked with middl…
Browse files Browse the repository at this point in the history
…e button
  • Loading branch information
aksyonov committed Nov 30, 2015
1 parent 1a67ae1 commit 8acf18f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/link-handler.js
Expand Up @@ -82,10 +82,10 @@ export class DefaultLinkHandler extends LinkHandler {
info.anchor = target;
info.href = href;

let hasModifierKey = (event.altKey || event.ctrlKey || event.metaKey || event.shiftKey);
let leftButtonClicked = event.which === 1;
let isRelative = href && !(href.charAt(0) === '#' || (/^[a-z]+:/i).test(href));

info.shouldHandleEvent = !hasModifierKey && isRelative;
info.shouldHandleEvent = leftButtonClicked && isRelative;
return info;
}

Expand Down

0 comments on commit 8acf18f

Please sign in to comment.