#255 - support textarea and update user settings page

This commit is contained in:
jared 2019-03-26 13:40:37 -04:00
parent 441deb405d
commit 2927454233
5 changed files with 34 additions and 6 deletions

View File

@ -5,7 +5,8 @@ const EmojiInput = {
props: [
'value',
'placeholder',
'type'
'type',
'classname'
],
data () {
return {

View File

@ -1,7 +1,8 @@
<template>
<div class="emoji-input">
<input
class="form-control"
v-if="type !== 'textarea'"
:class="classname"
:type="type"
:value="value"
:placeholder="placeholder"
@ -15,6 +16,21 @@
@keydown.tab="cycleForward"
@keydown.enter="replaceEmoji"
/>
<textarea
v-else
:class="classname"
:value="value"
:placeholder="placeholder"
@input="onInput"
@click="setCaret"
@keyup="setCaret"
@keydown="onKeydown"
@keydown.down="cycleForward"
@keydown.up="cycleBackward"
@keydown.shift.tab="cycleBackward"
@keydown.tab="cycleForward"
@keydown.enter="replaceEmoji"
></textarea>
<div class="autocomplete-panel" v-if="suggestions">
<div class="autocomplete-panel-body">
<div

View File

@ -15,7 +15,7 @@
type="text"
:placeholder="$t('post_status.content_warning')"
v-model="newStatus.spoilerText"
class="form-cw"
classname="form-control"
/>
<textarea
ref="textarea"

View File

@ -7,6 +7,7 @@ import StyleSwitcher from '../style_switcher/style_switcher.vue'
import fileSizeFormatService from '../../services/file_size_format/file_size_format.js'
import BlockCard from '../block_card/block_card.vue'
import MuteCard from '../mute_card/mute_card.vue'
import EmojiInput from '../emoji-input/emoji-input.vue'
import withSubscription from '../../hocs/with_subscription/with_subscription'
import withList from '../../hocs/with_list/with_list'
@ -69,7 +70,8 @@ const UserSettings = {
TabSwitcher,
ImageCropper,
BlockList,
MuteList
MuteList,
EmojiInput
},
computed: {
user () {

View File

@ -22,9 +22,18 @@
<div class="setting-item" >
<h2>{{$t('settings.name_bio')}}</h2>
<p>{{$t('settings.name')}}</p>
<input class='name-changer' id='username' v-model="newName"></input>
<EmojiInput
type="text"
v-model="newName"
id="username"
classname="name-changer"
/>
<p>{{$t('settings.bio')}}</p>
<textarea class="bio" v-model="newBio"></textarea>
<EmojiInput
type="textarea"
v-model="newBio"
classname="bio"
/>
<p>
<input type="checkbox" v-model="newLocked" id="account-locked">
<label for="account-locked">{{$t('settings.lock_account_description')}}</label>