This commit is contained in:
Nazar Kanaev 2021-03-29 09:54:25 +01:00
parent 3ed1b3e612
commit aa015b78c0
3 changed files with 7 additions and 14 deletions

View File

@ -214,7 +214,7 @@
<span class="icon">{% inline "sliders.svg" %}</span> <span class="icon">{% inline "sliders.svg" %}</span>
</template> </template>
<div class="row text-center m-0"> <div class="row text-center m-0">
<button class="dropdown-item col-4 px-0" <button class="btn btn-link col-4 px-0 rounded-0"
:class="'theme-'+t" :class="'theme-'+t"
@click.stop="theme.name = t" @click.stop="theme.name = t"
v-for="t in ['light', 'sepia', 'night']"> v-for="t in ['light', 'sepia', 'night']">

View File

@ -104,12 +104,7 @@ Vue.component('dropdown', {
}, },
methods: { methods: {
toggle: function(e) { toggle: function(e) {
if (this.open) { this.open ? this.hide() : this.show()
this.hide()
} else {
e.stopPropagation()
this.show()
}
}, },
show: function(e) { show: function(e) {
this.open = true this.open = true
@ -134,8 +129,9 @@ Vue.component('dropdown', {
document.removeEventListener('click', this.clickHandler) document.removeEventListener('click', this.clickHandler)
}, },
clickHandler: function(e) { clickHandler: function(e) {
if (e.target.closest('.dropdown') == null) this.hide() var dropdown = e.target.closest('.dropdown')
if (e.target.closest('.dropdown-item') != null) this.hide() if (dropdown == null || dropdown != this.$el) return this.hide()
if (e.target.closest('.dropdown-item') != null) return this.hide()
} }
}, },
}) })

View File

@ -416,7 +416,6 @@ a,
color: #0080d4; color: #0080d4;
} }
.theme-light.dropdown-item:hover,
.dropdown-item.active, .dropdown-item.active,
.dropdown-item:active, .dropdown-item:active,
.selectgroup input:checked + .selectgroup-label { .selectgroup input:checked + .selectgroup-label {
@ -432,7 +431,6 @@ a,
/* theme: sepia */ /* theme: sepia */
.theme-sepia, .theme-sepia,
.theme-sepia.dropdown-item:hover,
.theme-sepia .toolbar-search { .theme-sepia .toolbar-search {
background-color: #f4f0e5; background-color: #f4f0e5;
} }
@ -442,6 +440,7 @@ a,
.theme-sepia .border-top { .theme-sepia .border-top {
border-color: #e0d6ba !important; border-color: #e0d6ba !important;
} }
.theme-sepia .selectgroup-label:hover,
.theme-sepia .toolbar-item:hover, .theme-sepia .toolbar-item:hover,
.theme-sepia .toolbar-search:hover, .theme-sepia .toolbar-search:hover,
.theme-sepia .toolbar-search:focus { .theme-sepia .toolbar-search:focus {
@ -451,19 +450,17 @@ a,
/* theme: night */ /* theme: night */
.theme-night, .theme-night,
.theme-night.dropdown-item:hover,
.theme-night .toolbar-search { .theme-night .toolbar-search {
color: #d1d1d1; color: #d1d1d1;
background-color: #0e0e0e; background-color: #0e0e0e;
} }
.theme-night .content hr, .theme-night .content hr,
.theme-night .content pre, .theme-night .content pre,
.theme-night .border-right, .theme-night .border-right,
.theme-night .border-top { .theme-night .border-top {
border-color: #1a1a1a !important; border-color: #1a1a1a !important;
} }
.theme-night .selectgroup-label:hover,
.theme-night .toolbar-item:hover, .theme-night .toolbar-item:hover,
.theme-night .toolbar-search:hover, .theme-night .toolbar-search:hover,
.theme-night .toolbar-search:focus { .theme-night .toolbar-search:focus {