Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorKushal Pandya <kushal@gitlab.com>2017-02-07 19:10:14 +0300
committerKushal Pandya <kushal@gitlab.com>2017-02-07 19:10:14 +0300
commita11b23046fc95fa30c6eb3d3cdb2fb994e1fbe92 (patch)
treef997c1ba7dbb9ced0548456bc00722698958a392 /app
parent936f463bafcbe846f231f14ae29db20a920b1ca8 (diff)
Use `gl.utils.isMetaClick` to identify meta-clicks
Diffstat (limited to 'app')
-rw-r--r--app/assets/javascripts/merge_request_tabs.js.es66
-rw-r--r--app/assets/javascripts/todos.js.es66
2 files changed, 2 insertions, 10 deletions
diff --git a/app/assets/javascripts/merge_request_tabs.js.es6 b/app/assets/javascripts/merge_request_tabs.js.es6
index 43ba94ada9b..186cb3e9190 100644
--- a/app/assets/javascripts/merge_request_tabs.js.es6
+++ b/app/assets/javascripts/merge_request_tabs.js.es6
@@ -104,11 +104,7 @@ require('./flash');
clickTab(e) {
if (e.target) {
const targetLink = e.target.getAttribute('href');
- // Allow following special clicks to make link open in new tab
- // 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) {
+ if (gl.utils.isMetaClick(e)) {
e.stopImmediatePropagation();
window.open(targetLink, '_blank');
}
diff --git a/app/assets/javascripts/todos.js.es6 b/app/assets/javascripts/todos.js.es6
index 5b1b585dfac..b07e62a8c30 100644
--- a/app/assets/javascripts/todos.js.es6
+++ b/app/assets/javascripts/todos.js.es6
@@ -157,11 +157,7 @@
return;
}
- // Allow following special clicks to make link open in new tab
- // 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) {
+ if (gl.utils.isMetaClick(e)) {
e.preventDefault();
// Meta-Click on username leads to different URL than todoLink.
// Turbolinks can resolve that URL, but window.open requires URL manually.