diff options
author | Annabel Dunstone Gray <annabel.dunstone@gmail.com> | 2017-02-09 11:19:26 -0600 |
---|---|---|
committer | Annabel Dunstone Gray <annabel.dunstone@gmail.com> | 2017-02-10 15:09:08 -0600 |
commit | 5430849ca55192b78f7bfb35fdabaa3356e15035 (patch) | |
tree | 6f8870f80047efb4478dce11eef7902dab303c6b | |
parent | 7cbceef0a8290078eb2feb3956aa311628552229 (diff) | |
download | gitlab-ce-5430849ca55192b78f7bfb35fdabaa3356e15035.tar.gz |
Replace accidentally deleted metaclick
-rw-r--r-- | app/assets/javascripts/lib/utils/common_utils.js.es6 | 8 |
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(); |