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