bio editable
This commit is contained in:
parent
2df895ab02
commit
20beb30fc3
5 changed files with 57 additions and 32 deletions
|
|
@ -205,12 +205,6 @@ const EmojiInput = {
|
||||||
return emoji.displayText
|
return emoji.displayText
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onInputScroll () {
|
|
||||||
this.$refs.hiddenOverlay.scrollTo({
|
|
||||||
top: this.input.scrollTop,
|
|
||||||
left: this.input.scrollLeft
|
|
||||||
})
|
|
||||||
},
|
|
||||||
suggestionListId () {
|
suggestionListId () {
|
||||||
return `suggestions-${this.randomSeed}`
|
return `suggestions-${this.randomSeed}`
|
||||||
},
|
},
|
||||||
|
|
@ -239,7 +233,6 @@ const EmojiInput = {
|
||||||
this.overlayStyle.fontSize = style.fontSize
|
this.overlayStyle.fontSize = style.fontSize
|
||||||
this.overlayStyle.wordWrap = style.wordWrap
|
this.overlayStyle.wordWrap = style.wordWrap
|
||||||
this.overlayStyle.whiteSpace = style.whiteSpace
|
this.overlayStyle.whiteSpace = style.whiteSpace
|
||||||
this.resize()
|
|
||||||
input.addEventListener('blur', this.onBlur)
|
input.addEventListener('blur', this.onBlur)
|
||||||
input.addEventListener('focus', this.onFocus)
|
input.addEventListener('focus', this.onFocus)
|
||||||
input.addEventListener('paste', this.onPaste)
|
input.addEventListener('paste', this.onPaste)
|
||||||
|
|
@ -302,6 +295,13 @@ const EmojiInput = {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
onInputScroll (e) {
|
||||||
|
this.$refs.hiddenOverlay.scrollTo({
|
||||||
|
top: this.input.scrollTop,
|
||||||
|
left: this.input.scrollLeft
|
||||||
|
})
|
||||||
|
this.setCaret(e)
|
||||||
|
},
|
||||||
triggerShowPicker () {
|
triggerShowPicker () {
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
this.$refs.picker.showPicker()
|
this.$refs.picker.showPicker()
|
||||||
|
|
@ -561,8 +561,6 @@ const EmojiInput = {
|
||||||
this.$refs.suggestorPopover.updateStyles()
|
this.$refs.suggestorPopover.updateStyles()
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
resize () {
|
|
||||||
},
|
|
||||||
autoCompleteItemLabel (suggestion) {
|
autoCompleteItemLabel (suggestion) {
|
||||||
if (suggestion.user) {
|
if (suggestion.user) {
|
||||||
return suggestion.displayText + ' ' + suggestion.detailText
|
return suggestion.displayText + ' ' + suggestion.detailText
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,6 @@
|
||||||
<template>
|
<template>
|
||||||
<div class="profile-tab">
|
<div class="profile-tab">
|
||||||
<div class="setting-item">
|
<div class="setting-item">
|
||||||
<h2>{{ $t('settings.name_bio') }}</h2>
|
|
||||||
<UserCard
|
<UserCard
|
||||||
:user-id="user.id"
|
:user-id="user.id"
|
||||||
:editable="true"
|
:editable="true"
|
||||||
|
|
@ -23,20 +22,6 @@
|
||||||
>
|
>
|
||||||
</template>
|
</template>
|
||||||
</EmojiInput>
|
</EmojiInput>
|
||||||
<p>{{ $t('settings.bio') }}</p>
|
|
||||||
<EmojiInput
|
|
||||||
v-model="newBio"
|
|
||||||
enable-emoji-picker
|
|
||||||
:suggest="emojiUserSuggestor"
|
|
||||||
>
|
|
||||||
<template #default="inputProps">
|
|
||||||
<textarea
|
|
||||||
v-model="newBio"
|
|
||||||
class="input bio resize-height"
|
|
||||||
v-bind="propsToNative(inputProps)"
|
|
||||||
/>
|
|
||||||
</template>
|
|
||||||
</EmojiInput>
|
|
||||||
<p v-if="role === 'admin' || role === 'moderator'">
|
<p v-if="role === 'admin' || role === 'moderator'">
|
||||||
<Checkbox v-model="showRole">
|
<Checkbox v-model="showRole">
|
||||||
<template v-if="role === 'admin'">
|
<template v-if="role === 'admin'">
|
||||||
|
|
|
||||||
|
|
@ -93,6 +93,7 @@ export default {
|
||||||
newName: user.name_unescaped,
|
newName: user.name_unescaped,
|
||||||
newActorType: user.actor_type,
|
newActorType: user.actor_type,
|
||||||
newBio: unescape(user.description),
|
newBio: unescape(user.description),
|
||||||
|
editingBio: false,
|
||||||
newBirthday: user.birthday,
|
newBirthday: user.birthday,
|
||||||
newShowBirthday: user.show_birthday,
|
newShowBirthday: user.show_birthday,
|
||||||
newFields: user.fields.map(field => ({ name: field.name, value: field.value })),
|
newFields: user.fields.map(field => ({ name: field.name, value: field.value })),
|
||||||
|
|
|
||||||
|
|
@ -13,11 +13,21 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.input.bio {
|
||||||
|
height: auto; // override settings default textarea size
|
||||||
|
}
|
||||||
|
|
||||||
.user-card-inner {
|
.user-card-inner {
|
||||||
padding-bottom: 0;
|
padding-bottom: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.user-card-bio {
|
.user-card-bio {
|
||||||
|
margin: 0.6em;
|
||||||
|
|
||||||
|
&, * {
|
||||||
|
line-height: 1.5;
|
||||||
|
}
|
||||||
|
|
||||||
&.-justify-left {
|
&.-justify-left {
|
||||||
text-align: start;
|
text-align: start;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -315,6 +315,18 @@
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<h4 v-if="editable">
|
||||||
|
<span>
|
||||||
|
{{ $t('settings.bio') }}
|
||||||
|
</span>
|
||||||
|
<button
|
||||||
|
class="button-default"
|
||||||
|
@click="editingBio = !editingBio"
|
||||||
|
>
|
||||||
|
{{ $t('settings.toggle_edit') }}
|
||||||
|
</button>
|
||||||
|
</h4>
|
||||||
|
<template v-if="!editable || !editingBio">
|
||||||
<RichContent
|
<RichContent
|
||||||
v-if="!hideBio"
|
v-if="!hideBio"
|
||||||
class="user-card-bio"
|
class="user-card-bio"
|
||||||
|
|
@ -323,6 +335,25 @@
|
||||||
:emoji="editable ? emoji : user.emoji"
|
:emoji="editable ? emoji : user.emoji"
|
||||||
:handle-links="true"
|
:handle-links="true"
|
||||||
/>
|
/>
|
||||||
|
</template>
|
||||||
|
<template v-else-if="editingBio">
|
||||||
|
<EmojiInput
|
||||||
|
v-model="newBio"
|
||||||
|
enable-emoji-picker
|
||||||
|
class="user-card-bio"
|
||||||
|
:class="{ '-justify-left': mergedConfig.userCardLeftJustify }"
|
||||||
|
:suggest="emojiUserSuggestor"
|
||||||
|
>
|
||||||
|
<template #default="inputProps">
|
||||||
|
<textarea
|
||||||
|
v-model="newBio"
|
||||||
|
class="input bio resize-height"
|
||||||
|
v-bind="propsToNative(inputProps)"
|
||||||
|
:rows="newBio.split(/\n/g).length"
|
||||||
|
/>
|
||||||
|
</template>
|
||||||
|
</EmojiInput>
|
||||||
|
</template>
|
||||||
<h4 v-if="editable">
|
<h4 v-if="editable">
|
||||||
<span>
|
<span>
|
||||||
{{ $t('settings.profile_fields.label') }}
|
{{ $t('settings.profile_fields.label') }}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue