summaryrefslogtreecommitdiff
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
parentf106ad513546c8d77b88a0a061a0b6a7e7ee26ed (diff)
downloadgitlab-ce-4792eb7ab427ec2568b932b5b5714d55f55fdeb3.tar.gz
fixes job dropdown action button error
-rw-r--r--app/assets/javascripts/vue_pipelines_index/stage.js.es616
-rw-r--r--changelogs/unreleased/27530-fix-job-dropdown-pipeline-console-error.yml4
2 files changed, 14 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();
},
diff --git a/changelogs/unreleased/27530-fix-job-dropdown-pipeline-console-error.yml b/changelogs/unreleased/27530-fix-job-dropdown-pipeline-console-error.yml
new file mode 100644
index 00000000000..4436b4bee68
--- /dev/null
+++ b/changelogs/unreleased/27530-fix-job-dropdown-pipeline-console-error.yml
@@ -0,0 +1,4 @@
+---
+title: Fixes job dropdown action throws error in js console
+merge_request: 9182
+author: