replace quote/reply with radiogroup and made it wrap
This commit is contained in:
parent
e82fa41f88
commit
1227061655
3 changed files with 24 additions and 33 deletions
|
|
@ -373,14 +373,20 @@ const PostStatusForm = {
|
|||
quotable() {
|
||||
return this.quotingAvailable && this.replyTo
|
||||
},
|
||||
quoteThreadToggled() {
|
||||
return this.newStatus.hasQuote && this.newStatus.quote.thread
|
||||
quoteThreadToggled: {
|
||||
get() {
|
||||
return this.newStatus.hasQuote && this.newStatus.quote.thread
|
||||
},
|
||||
set(value) {
|
||||
this.newStatus.hasQuote = value
|
||||
this.newStatus.quote.thread = value
|
||||
this.newStatus.quote.id = value ? this.replyTo : ''
|
||||
}
|
||||
},
|
||||
defaultQuotable() {
|
||||
if (
|
||||
!this.quotingAvailable ||
|
||||
!this.isReply ||
|
||||
!this.$store.getters.mergedConfig.quoteReply
|
||||
!this.isReply
|
||||
) {
|
||||
return false
|
||||
}
|
||||
|
|
@ -868,11 +874,6 @@ const PostStatusForm = {
|
|||
quote.url = ''
|
||||
quote.thread = quotable
|
||||
},
|
||||
setQuoteThread(v) {
|
||||
this.newStatus.hasQuote = v
|
||||
this.newStatus.quote.thread = v
|
||||
this.newStatus.quote.id = v ? this.replyTo : ''
|
||||
},
|
||||
clearQuoteForm() {
|
||||
if (this.$refs.quoteForm) {
|
||||
this.$refs.quoteForm.clear()
|
||||
|
|
|
|||
|
|
@ -90,9 +90,10 @@
|
|||
}
|
||||
|
||||
.reply-or-quote-selector {
|
||||
flex: 1 0 auto;
|
||||
flex-wrap: wrap;
|
||||
margin-bottom: 0.5em;
|
||||
display: grid;
|
||||
gap: 1em;
|
||||
display: flex;
|
||||
grid-template-columns: 1fr 1fr;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -88,7 +88,7 @@
|
|||
</div>
|
||||
<div
|
||||
v-if="!disablePreview"
|
||||
class="preview-heading faint"
|
||||
class="preview-heading"
|
||||
>
|
||||
<a
|
||||
class="preview-toggle faint"
|
||||
|
|
@ -110,34 +110,23 @@
|
|||
<div
|
||||
v-if="quotable"
|
||||
role="radiogroup"
|
||||
class="btn-group reply-or-quote-selector"
|
||||
class="reply-or-quote-selector"
|
||||
>
|
||||
<button
|
||||
:id="`reply-or-quote-option-${randomSeed}-reply`"
|
||||
class="btn button-default reply-or-quote-option"
|
||||
:class="{ toggled: !quoteThreadToggled }"
|
||||
tabindex="0"
|
||||
<Checkbox
|
||||
role="radio"
|
||||
:disabled="quoteFormVisible"
|
||||
:aria-labelledby="`reply-or-quote-option-${randomSeed}-reply`"
|
||||
:aria-checked="!newStatus.quote.thread"
|
||||
@click="setQuoteThread(false)"
|
||||
:radio="true"
|
||||
:model-value="!quoteThreadToggled"
|
||||
@update:model-value="e => quoteThreadToggled = !e"
|
||||
>
|
||||
{{ $t('post_status.reply_option') }}
|
||||
</button>
|
||||
<button
|
||||
:id="`reply-or-quote-option-${randomSeed}-quote`"
|
||||
class="btn button-default reply-or-quote-option"
|
||||
:class="{ toggled: quoteThreadToggled }"
|
||||
tabindex="0"
|
||||
role="radio"
|
||||
</Checkbox>
|
||||
<Checkbox
|
||||
v-model="quoteThreadToggled"
|
||||
:radio="true"
|
||||
:disabled="quoteFormVisible"
|
||||
:aria-labelledby="`reply-or-quote-option-${randomSeed}-quote`"
|
||||
:aria-checked="newStatus.quote.thread"
|
||||
@click="setQuoteThread(true)"
|
||||
>
|
||||
{{ $t('post_status.quote_option') }}
|
||||
</button>
|
||||
</Checkbox>
|
||||
</div>
|
||||
</div>
|
||||
<div
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue