summaryrefslogtreecommitdiff
path: root/app/assets/javascripts/pages
diff options
context:
space:
mode:
authorMike Greiling <mike@pixelcog.com>2018-06-06 04:44:42 -0500
committerMike Greiling <mike@pixelcog.com>2018-06-06 04:44:42 -0500
commitd9c67a709be457457373ca87b015e846044bfff6 (patch)
treeee8658c022d2ce4dd2350227e133928e32691980 /app/assets/javascripts/pages
parent2c11cab38c85a15b6f8f950d8c614fe601e51933 (diff)
downloadgitlab-ce-d9c67a709be457457373ca87b015e846044bfff6.tar.gz
show/hide the extra auto devops settings when appropriate
Diffstat (limited to 'app/assets/javascripts/pages')
-rw-r--r--app/assets/javascripts/pages/projects/settings/ci_cd/show/index.js13
1 files changed, 13 insertions, 0 deletions
diff --git a/app/assets/javascripts/pages/projects/settings/ci_cd/show/index.js b/app/assets/javascripts/pages/projects/settings/ci_cd/show/index.js
index 6c2a785c0af..6d227177cb4 100644
--- a/app/assets/javascripts/pages/projects/settings/ci_cd/show/index.js
+++ b/app/assets/javascripts/pages/projects/settings/ci_cd/show/index.js
@@ -22,4 +22,17 @@ document.addEventListener('DOMContentLoaded', () => {
errorBox: variableListEl.querySelector('.js-ci-variable-error-box'),
saveEndpoint: variableListEl.dataset.saveEndpoint,
});
+
+ // hide extra auto devops settings based on data-attributes
+ const autoDevOpsSettings = document.querySelectorAll('input[data-hide-extra-settings]');
+ const autoDevOpsExtraSettings = document.querySelector('.js-extra-settings');
+
+ autoDevOpsSettings.forEach(input => {
+ input.addEventListener('click', () =>
+ autoDevOpsExtraSettings.classList.toggle(
+ 'hidden',
+ input.dataset.hideExtraSettings === 'true',
+ ),
+ );
+ });
});