summaryrefslogtreecommitdiff
path: root/app/assets
diff options
context:
space:
mode:
authorNur Rony <pro.nmrony@gmail.com>2017-02-13 16:10:39 +0600
committerFilipa Lacerda <filipa@gitlab.com>2017-02-23 12:19:49 +0000
commit4792eb7ab427ec2568b932b5b5714d55f55fdeb3 (patch)
treeabace25f2e6094d51bfa4fd8df741c5b8f8ad12e /app/assets
parentf106ad513546c8d77b88a0a061a0b6a7e7ee26ed (diff)
downloadgitlab-ce-4792eb7ab427ec2568b932b5b5714d55f55fdeb3.tar.gz
fixes job dropdown action button error
Diffstat (limited to 'app/assets')
-rw-r--r--app/assets/javascripts/vue_pipelines_index/stage.js.es616
1 files changed, 10 insertions, 6 deletions
diff --git a/app/assets/javascripts/vue_pipelines_index/stage.js.es6 b/app/assets/javascripts/vue_pipelines_index/stage.js.es6
index 8cc417a9966..cfe6ea10140 100644
--- a/app/assets/javascripts/vue_pipelines_index/stage.js.es6
+++ b/app/assets/javascripts/vue_pipelines_index/stage.js.es6
@@ -37,15 +37,19 @@
return flash;
});
},
+ /**
+ * When the user right clicks or cmd/ctrl + click in the job name or action icon,
+ * the dropdown should not be closed and the link should open in another tab.
+ * If the target is a svg we stop propagation in order to prevent
+ * the default behavior of the dropdown.
+ */
keepGraph(e) {
const { target } = e;
+ const svgClassName = target.getAttribute('class');
+ const svgParentClassName = target.parentElement && target.parentElement.getAttribute('class');
- if (target.className.indexOf('js-ci-action-icon') >= 0) return null;
-
- if (
- target.parentElement &&
- (target.parentElement.className.indexOf('js-ci-action-icon') >= 0)
- ) return null;
+ if (svgClassName && svgClassName.indexOf('js-ci-action-icon') >= 0) return null;
+ if (svgParentClassName && svgParentClassName.indexOf('js-ci-action-icon') >= 0) return null;
return e.stopPropagation();
},