From c6880c12227aaa4be6df358045d51d24f5d0dcec Mon Sep 17 00:00:00 2001 From: MattIPv4 Date: Thu, 21 May 2020 17:39:13 +0100 Subject: [PATCH] Fix remove button behaviour --- src/nginxconfig/scss/style.scss | 60 ++++++++++++++++++++++++------- src/nginxconfig/templates/app.vue | 10 +++--- 2 files changed, 54 insertions(+), 16 deletions(-) diff --git a/src/nginxconfig/scss/style.scss b/src/nginxconfig/scss/style.scss index 897e7f4..189c7ae 100644 --- a/src/nginxconfig/scss/style.scss +++ b/src/nginxconfig/scss/style.scss @@ -24,15 +24,28 @@ $highlight: #f2c94c; $pretty--color-dark: $primary; $pretty--color-default: $primary; @import "~pretty-checkbox/src/pretty-checkbox"; - $vs-state-active-bg: $primary; - $vs-border-radius: $border-radius; $vs-border-color: $border; + $vs-border-radius: $border-radius; $vs-dropdown-box-shadow: 0 2px 4px rgba($dark-blue, .06); + $vs-state-active-bg: $primary; @import "~vue-select/src/scss/vue-select"; .tabs { ul { li { + display: flex; + flex-direction: row; + flex-wrap: nowrap; + + &:hover, + &:focus { + a { + &::after { + background: $dark-blue; + } + } + } + &.is-before { a { color: mix($dark-grey, $primary); @@ -58,22 +71,45 @@ $highlight: #f2c94c; } a { + &.domain { + flex-grow: 1; + padding-right: .25rem; + + &::after { + border-bottom-right-radius: 0; + border-top-right-radius: 0; + } + } + + &.remove { + padding-left: .25rem; + transition: color $transition; + + &::after { + border-bottom-left-radius: 0; + border-top-left-radius: 0; + } + + &:hover, + &:focus { + color: $danger; + + &::after { + background: $danger; + } + } + + i { + margin: 0; + } + } + i { font-size: .75em; &.fa-plus { margin: 0 .35rem 0 0; } - - &.fa-times { - margin: 0 0 0 .5rem; - transition: color $transition; - - &:hover, - &:focus { - color: $danger; - } - } } } } diff --git a/src/nginxconfig/templates/app.vue b/src/nginxconfig/templates/app.vue index c567f37..9bc4db7 100644 --- a/src/nginxconfig/templates/app.vue +++ b/src/nginxconfig/templates/app.vue @@ -36,9 +36,11 @@ limitations under the License.
@@ -157,7 +159,7 @@ limitations under the License. }, remove(index) { this.$set(this.$data.domains, index, null); - if (this.$data.active === index) this.$data.active = 0; + if (this.$data.active === index) this.$data.active = this.$data.domains.findIndex(d => d !== null); }, }, };