diff options
author | Phil Hughes <me@iamphill.com> | 2016-10-21 13:21:14 +0300 |
---|---|---|
committer | Phil Hughes <me@iamphill.com> | 2016-11-01 12:20:31 +0300 |
commit | bdf7365d85af83512ca1ab316be7043ad5951f41 (patch) | |
tree | c38e5f214bd0c3a13136aafcf7da9d290ce742d0 /app/assets | |
parent | 266fcfb1935c8aa8c6ac3d2ae71530c441b08675 (diff) |
Hides registry if project is disabled
Diffstat (limited to 'app/assets')
-rw-r--r-- | app/assets/javascripts/project_new.js | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/app/assets/javascripts/project_new.js b/app/assets/javascripts/project_new.js index 40575caa57f..0d3fb31a9cf 100644 --- a/app/assets/javascripts/project_new.js +++ b/app/assets/javascripts/project_new.js @@ -45,7 +45,9 @@ }; ProjectNew.prototype.toggleRepoVisibility = function () { - var $repoAccessLevel = $('.js-repo-access-level select'); + var $repoAccessLevel = $('.js-repo-access-level select'), + containerRegistry = document.querySelectorAll('.js-container-registry')[0], + containerRegistryCheckbox = document.getElementById('project_container_registry_enabled'); this.$repoSelects.find("option[value='" + $repoAccessLevel.val() + "']") .nextAll() @@ -70,8 +72,17 @@ if (selectedVal) { this.$repoSelects.removeClass('disabled'); + + if (containerRegistry) { + containerRegistry.style.display = ''; + } } else { this.$repoSelects.addClass('disabled'); + + if (containerRegistry) { + containerRegistry.style.display = 'none'; + containerRegistryCheckbox.checked = false; + } } }.bind(this)); }; |