diff options
author | Mike Greiling <mike@pixelcog.com> | 2018-08-06 21:51:37 +0000 |
---|---|---|
committer | Clement Ho <clemmakesapps@gmail.com> | 2018-08-06 21:51:37 +0000 |
commit | e3127132a498cd3a39a325a5c0912ca6121e2f8a (patch) | |
tree | a4ab1c6cdd871dd6f4134387bed9da4021c0ec0d /app/assets/javascripts/pages | |
parent | d737abc537476bf2b500f550b0c733d22f338cf1 (diff) | |
download | gitlab-ce-e3127132a498cd3a39a325a5c0912ca6121e2f8a.tar.gz |
Resolve "Improve Auto DevOps settings flow for admin and project"
Diffstat (limited to 'app/assets/javascripts/pages')
-rw-r--r-- | app/assets/javascripts/pages/projects/settings/ci_cd/show/index.js | 15 |
1 files changed, 5 insertions, 10 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 1faa59fb45b..8f5ac3d8082 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 @@ -23,17 +23,12 @@ document.addEventListener('DOMContentLoaded', () => { saveEndpoint: variableListEl.dataset.saveEndpoint, }); - // hide extra auto devops settings based on data-attributes - const autoDevOpsSettings = document.querySelector('.js-auto-devops-settings'); + // hide extra auto devops settings based checkbox state const autoDevOpsExtraSettings = document.querySelector('.js-extra-settings'); - - autoDevOpsSettings.addEventListener('click', event => { + const instanceDefaultBadge = document.querySelector('.js-instance-default-badge'); + document.querySelector('.js-toggle-extra-settings').addEventListener('click', event => { const { target } = event; - if (target.classList.contains('js-toggle-extra-settings')) { - autoDevOpsExtraSettings.classList.toggle( - 'hidden', - !!(target.dataset && target.dataset.hideExtraSettings), - ); - } + if (instanceDefaultBadge) instanceDefaultBadge.style.display = 'none'; + autoDevOpsExtraSettings.classList.toggle('hidden', !target.checked); }); }); |