summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnnabel Dunstone Gray <annabel.dunstone@gmail.com>2017-02-09 11:19:26 -0600
committerAnnabel Dunstone Gray <annabel.dunstone@gmail.com>2017-02-10 15:09:08 -0600
commit5430849ca55192b78f7bfb35fdabaa3356e15035 (patch)
tree6f8870f80047efb4478dce11eef7902dab303c6b
parent7cbceef0a8290078eb2feb3956aa311628552229 (diff)
downloadgitlab-ce-5430849ca55192b78f7bfb35fdabaa3356e15035.tar.gz
Replace accidentally deleted metaclick
-rw-r--r--app/assets/javascripts/lib/utils/common_utils.js.es68
1 files changed, 8 insertions, 0 deletions
diff --git a/app/assets/javascripts/lib/utils/common_utils.js.es6 b/app/assets/javascripts/lib/utils/common_utils.js.es6
index a910999a440..2d4f1d3dbe7 100644
--- a/app/assets/javascripts/lib/utils/common_utils.js.es6
+++ b/app/assets/javascripts/lib/utils/common_utils.js.es6
@@ -125,6 +125,14 @@
return e.metaKey || e.ctrlKey || e.altKey || e.shiftKey;
};
+ gl.utils.isMetaClick = function(e) {
+ // Identify following special clicks
+ // 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)
+ return e.metaKey || e.ctrlKey || e.which === 2;
+ };
+
gl.utils.scrollToElement = function($el) {
var top = $el.offset().top;
gl.mrTabsHeight = gl.mrTabsHeight || $('.merge-request-tabs').height();