Commit a11b2304 authored by Kushal Pandya's avatar Kushal Pandya

Use `gl.utils.isMetaClick` to identify meta-clicks

parent 936f463b
...@@ -104,11 +104,7 @@ require('./flash'); ...@@ -104,11 +104,7 @@ require('./flash');
clickTab(e) { clickTab(e) {
if (e.target) { if (e.target) {
const targetLink = e.target.getAttribute('href'); const targetLink = e.target.getAttribute('href');
// Allow following special clicks to make link open in new tab if (gl.utils.isMetaClick(e)) {
// 1) Cmd + Click on Mac (e.metaKey)
// 2) Ctrl + Click on PC (e.ctrlKey)
// 3) Middle-click or Mouse Wheel Click (e.which is 2)
if (e.metaKey || e.ctrlKey || e.which === 2) {
e.stopImmediatePropagation(); e.stopImmediatePropagation();
window.open(targetLink, '_blank'); window.open(targetLink, '_blank');
} }
......
...@@ -157,11 +157,7 @@ ...@@ -157,11 +157,7 @@
return; return;
} }
// Allow following special clicks to make link open in new tab if (gl.utils.isMetaClick(e)) {
// 1) Cmd + Click on Mac (e.metaKey)
// 2) Ctrl + Click on PC (e.ctrlKey)
// 3) Middle-click or Mouse Wheel Click (e.which is 2)
if (e.metaKey || e.ctrlKey || e.which === 2) {
e.preventDefault(); e.preventDefault();
// Meta-Click on username leads to different URL than todoLink. // Meta-Click on username leads to different URL than todoLink.
// Turbolinks can resolve that URL, but window.open requires URL manually. // Turbolinks can resolve that URL, but window.open requires URL manually.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment