logo

pleroma-fe

My custom branche(s) on git.pleroma.social/pleroma/pleroma-fe git clone https://hacktivis.me/git/pleroma-fe.git
commit: 4539feed409e7f934f5d9d3ccd4944b34350fa2a
parent 97930020706c938d9237cdc3770fab11b03bedc1
Author: Henry Jameson <me@hjkos.com>
Date:   Thu, 24 Mar 2022 11:41:39 +0200

fix checkboxes, specifically the NSFW one

Diffstat:

Msrc/components/checkbox/checkbox.vue11++++-------
Msrc/components/color_input/color_input.vue2+-
Msrc/components/font_control/font_control.vue2+-
Msrc/components/opacity_input/opacity_input.vue2+-
Msrc/components/range_input/range_input.vue2+-
Msrc/components/selectable_list/selectable_list.vue4++--
Msrc/components/settings_modal/helpers/boolean_setting.vue4++--
Msrc/components/settings_modal/settings_modal.vue2+-
Msrc/components/user_reporting_modal/user_reporting_modal.vue2+-
9 files changed, 14 insertions(+), 17 deletions(-)

diff --git a/src/components/checkbox/checkbox.vue b/src/components/checkbox/checkbox.vue @@ -6,9 +6,9 @@ <input type="checkbox" :disabled="disabled" - :checked="checked" + :modelValue="modelValue" :indeterminate="indeterminate" - @change="$emit('change', $event.target.checked)" + @change="$emit('update:modelValue', $event.target.checked)" > <i class="checkbox-indicator" /> <span @@ -22,12 +22,9 @@ <script> export default { - model: { - prop: 'checked', - event: 'change' - }, + emits: ['update:modelValue'], props: [ - 'checked', + 'modelValue', 'indeterminate', 'disabled' ] diff --git a/src/components/color_input/color_input.vue b/src/components/color_input/color_input.vue @@ -11,7 +11,7 @@ </label> <Checkbox v-if="typeof fallback !== 'undefined' && showOptionalTickbox" - :checked="present" + :modelValue="present" :disabled="disabled" class="opt" @change="$emit('update:modelValue', typeof value === 'undefined' ? fallback : undefined)" diff --git a/src/components/font_control/font_control.vue b/src/components/font_control/font_control.vue @@ -14,7 +14,7 @@ :id="name + '-o'" class="opt exlcude-disabled" type="checkbox" - :checked="present" + :modelValue="present" @input="$emit('update:modelValue', typeof value === 'undefined' ? fallback : undefined)" > <label diff --git a/src/components/opacity_input/opacity_input.vue b/src/components/opacity_input/opacity_input.vue @@ -11,7 +11,7 @@ </label> <Checkbox v-if="typeof fallback !== 'undefined'" - :checked="present" + :modelValue="present" :disabled="disabled" class="opt" @change="$emit('update:modelValue', !present ? fallback : undefined)" diff --git a/src/components/range_input/range_input.vue b/src/components/range_input/range_input.vue @@ -14,7 +14,7 @@ :id="name + '-o'" class="opt" type="checkbox" - :checked="present" + :modelValue="present" @input="$emit('update:modelValue', !present ? fallback : undefined)" > <label diff --git a/src/components/selectable_list/selectable_list.vue b/src/components/selectable_list/selectable_list.vue @@ -6,7 +6,7 @@ > <div class="selectable-list-checkbox-wrapper"> <Checkbox - :checked="allSelected" + :modelValue="allSelected" :indeterminate="someSelected" @change="toggleAll" > @@ -31,7 +31,7 @@ > <div class="selectable-list-checkbox-wrapper"> <Checkbox - :checked="isSelected(item)" + :modelValue="isSelected(item)" @change="checked => toggle(checked, item)" /> </div> diff --git a/src/components/settings_modal/helpers/boolean_setting.vue b/src/components/settings_modal/helpers/boolean_setting.vue @@ -4,9 +4,9 @@ class="BooleanSetting" > <Checkbox - :checked="state" + :modelValue="state" :disabled="disabled" - @change="update" + @update:modelValue="update" > <span v-if="!!$slots.default" diff --git a/src/components/settings_modal/settings_modal.vue b/src/components/settings_modal/settings_modal.vue @@ -110,7 +110,7 @@ </template> </Popover> - <Checkbox :checked="!!expertLevel" @change="expertLevel = Number($event)"> + <Checkbox :modelValue="!!expertLevel" @update:modelValue="expertLevel = Number($event)"> {{ $t("settings.expert_mode") }} </Checkbox> </div> diff --git a/src/components/user_reporting_modal/user_reporting_modal.vue b/src/components/user_reporting_modal/user_reporting_modal.vue @@ -53,7 +53,7 @@ :statusoid="item" /> <Checkbox - :checked="isChecked(item.id)" + :modelValue="isChecked(item.id)" @change="checked => toggleStatus(checked, item.id)" /> </div>