kopia lustrzana https://github.com/nextcloud/social
Limit status message to 500 chars
Signed-off-by: Louis Chemineau <louis@chmn.me>pull/1744/head
rodzic
aa05d640f4
commit
6879d1cd72
|
@ -68,7 +68,7 @@
|
|||
:contenteditable="!loading"
|
||||
class="message"
|
||||
placeholder="What would you like to share?"
|
||||
:class="{'icon-loading': loading}"
|
||||
:class="{'icon-loading': loading, 'too-long': statusIsTooLong}"
|
||||
@keyup.prevent.enter="keyup"
|
||||
@input="updateStatusContent"
|
||||
@tribute-replaced="updatePostFromTribute" />
|
||||
|
@ -277,12 +277,24 @@ export default {
|
|||
return true
|
||||
}
|
||||
|
||||
return !this.statusIsEmpty
|
||||
if (this.statusIsTooLong) {
|
||||
return false
|
||||
}
|
||||
|
||||
if (this.statusIsEmpty) {
|
||||
return false
|
||||
}
|
||||
|
||||
return true
|
||||
},
|
||||
/** @return {boolean} */
|
||||
statusIsEmpty() {
|
||||
return this.statusContent.length === 0 || this.statusContent === '<br>'
|
||||
},
|
||||
|
||||
statusIsTooLong() {
|
||||
return this.statusContent.length > 500
|
||||
},
|
||||
},
|
||||
mounted() {
|
||||
this.$root.$on('composer-reply', (/** @type {import('../../types/Mastodon.js').Status} */data) => {
|
||||
|
@ -518,6 +530,10 @@ export default {
|
|||
min-width: 2px;
|
||||
display: block;
|
||||
|
||||
&.too-long {
|
||||
color: var(--color-error);
|
||||
}
|
||||
|
||||
:deep(.mention) {
|
||||
color: var(--color-primary-element);
|
||||
background-color: var(--color-background-dark);
|
||||
|
|
Ładowanie…
Reference in New Issue