diff options
author | Dennis Tang <dtang@gitlab.com> | 2018-05-06 18:04:25 +0200 |
---|---|---|
committer | Dennis Tang <dtang@gitlab.com> | 2018-05-06 18:04:25 +0200 |
commit | 41f2c1d564cc0fabae12d6743819f51a49963a1d (patch) | |
tree | 8b79f0ad77824359df8d765af7969bbb4bfc9d55 | |
parent | b53e544c8e7966d1b97c11e249ace68962b21bcc (diff) | |
download | gitlab-ce-41f2c1d564cc0fabae12d6743819f51a49963a1d.tar.gz |
show button toggle value as primary text color when single project is selected
-rw-r--r-- | app/assets/javascripts/projects/gke_cluster_dropdowns/components/gke_project_id_dropdown.vue | 5 | ||||
-rw-r--r-- | app/assets/stylesheets/framework/dropdowns.scss | 4 |
2 files changed, 8 insertions, 1 deletions
diff --git a/app/assets/javascripts/projects/gke_cluster_dropdowns/components/gke_project_id_dropdown.vue b/app/assets/javascripts/projects/gke_cluster_dropdowns/components/gke_project_id_dropdown.vue index 7efb038566d..bd63bfbd5ba 100644 --- a/app/assets/javascripts/projects/gke_cluster_dropdowns/components/gke_project_id_dropdown.vue +++ b/app/assets/javascripts/projects/gke_cluster_dropdowns/components/gke_project_id_dropdown.vue @@ -56,6 +56,9 @@ export default { computed: { ...mapState(['selectedProject']), ...mapGetters(['hasProject']), + hasOneProject() { + return this.items.length === 1; + }, isDisabled() { return this.items.length < 2; }, @@ -158,7 +161,7 @@ export default { :value="selectedProject.projectId" /> <dropdown-button - :class="{ 'gl-field-error-outline': hasErrors }" + :class="{ 'gl-field-error-outline': hasErrors, 'read-only': hasOneProject }" :is-disabled="isDisabled" :is-loading="isLoading" :toggle-text="toggleText" diff --git a/app/assets/stylesheets/framework/dropdowns.scss b/app/assets/stylesheets/framework/dropdowns.scss index 664aade7375..6576f7ca3b3 100644 --- a/app/assets/stylesheets/framework/dropdowns.scss +++ b/app/assets/stylesheets/framework/dropdowns.scss @@ -63,6 +63,10 @@ border-radius: $border-radius-base; white-space: nowrap; + &:disabled.read-only { + color: $gl-text-color !important; + } + &.no-outline { outline: 0; } |