aboutsummaryrefslogtreecommitdiff
path: root/src/components/checkbox/checkbox.vue
diff options
context:
space:
mode:
authorHJ <30-hj@users.noreply.git.pleroma.social>2023-05-24 18:55:20 +0000
committerHJ <30-hj@users.noreply.git.pleroma.social>2023-05-24 18:55:20 +0000
commitc730c9b6d0fac2b79e0fa5900117c66d073e4a9d (patch)
treeb33e33e9da2225c05cce2f47f87c5bc54d01cdc1 /src/components/checkbox/checkbox.vue
parent4bf085b8feb81ad52bad6cb8979786df22baba9e (diff)
parentcbd22d52b8d0cacf01f71edcb799294b93754f60 (diff)
Merge branch 'improve_settings_reusability' into 'develop'
AdminFE functionality in PleromaFE See merge request pleroma/pleroma-fe!1800
Diffstat (limited to 'src/components/checkbox/checkbox.vue')
-rw-r--r--src/components/checkbox/checkbox.vue28
1 files changed, 26 insertions, 2 deletions
diff --git a/src/components/checkbox/checkbox.vue b/src/components/checkbox/checkbox.vue
index 42f89be9..b8b77e7c 100644
--- a/src/components/checkbox/checkbox.vue
+++ b/src/components/checkbox/checkbox.vue
@@ -1,7 +1,7 @@
<template>
<label
class="checkbox"
- :class="{ disabled, indeterminate }"
+ :class="{ disabled, indeterminate, 'indeterminate-fix': indeterminateTransitionFix }"
>
<input
type="checkbox"
@@ -14,6 +14,7 @@
<i
class="checkbox-indicator"
:aria-hidden="true"
+ @transitionend.capture="onTransitionEnd"
/>
<span
v-if="!!$slots.default"
@@ -31,7 +32,24 @@ export default {
'indeterminate',
'disabled'
],
- emits: ['update:modelValue']
+ emits: ['update:modelValue'],
+ data: (vm) => ({
+ indeterminateTransitionFix: vm.indeterminate
+ }),
+ watch: {
+ indeterminate (e) {
+ if (e) {
+ this.indeterminateTransitionFix = true
+ }
+ }
+ },
+ methods: {
+ onTransitionEnd (e) {
+ if (!this.indeterminate) {
+ this.indeterminateTransitionFix = false
+ }
+ }
+ }
}
</script>
@@ -98,6 +116,12 @@ export default {
}
}
+ &.indeterminate-fix {
+ input[type="checkbox"] + .checkbox-indicator::before {
+ content: "–";
+ }
+ }
+
& > span {
margin-left: 0.5em;
}