diff options
| author | jared <jaredrmain@gmail.com> | 2019-03-26 13:40:37 -0400 |
|---|---|---|
| committer | jared <jaredrmain@gmail.com> | 2019-03-26 13:40:37 -0400 |
| commit | 29274542336b82b5a8c5c19f7e5ce476f489ae37 (patch) | |
| tree | 1b63a575c38b435c3effaa1be01d8a8809fee858 /src | |
| parent | 441deb405da1252ccab38501c0324ddea856f771 (diff) | |
#255 - support textarea and update user settings page
Diffstat (limited to 'src')
| -rw-r--r-- | src/components/emoji-input/emoji-input.js | 3 | ||||
| -rw-r--r-- | src/components/emoji-input/emoji-input.vue | 18 | ||||
| -rw-r--r-- | src/components/post_status_form/post_status_form.vue | 2 | ||||
| -rw-r--r-- | src/components/user_settings/user_settings.js | 4 | ||||
| -rw-r--r-- | src/components/user_settings/user_settings.vue | 13 |
5 files changed, 34 insertions, 6 deletions
diff --git a/src/components/emoji-input/emoji-input.js b/src/components/emoji-input/emoji-input.js index 56414358..a5bb6eaf 100644 --- a/src/components/emoji-input/emoji-input.js +++ b/src/components/emoji-input/emoji-input.js @@ -5,7 +5,8 @@ const EmojiInput = { props: [ 'value', 'placeholder', - 'type' + 'type', + 'classname' ], data () { return { diff --git a/src/components/emoji-input/emoji-input.vue b/src/components/emoji-input/emoji-input.vue index 95606305..568bd080 100644 --- a/src/components/emoji-input/emoji-input.vue +++ b/src/components/emoji-input/emoji-input.vue @@ -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 diff --git a/src/components/post_status_form/post_status_form.vue b/src/components/post_status_form/post_status_form.vue index 9d449b74..b2a1dc58 100644 --- a/src/components/post_status_form/post_status_form.vue +++ b/src/components/post_status_form/post_status_form.vue @@ -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" diff --git a/src/components/user_settings/user_settings.js b/src/components/user_settings/user_settings.js index 72e7bb53..5cb23b97 100644 --- a/src/components/user_settings/user_settings.js +++ b/src/components/user_settings/user_settings.js @@ -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 () { diff --git a/src/components/user_settings/user_settings.vue b/src/components/user_settings/user_settings.vue index c9e68808..27c2f47d 100644 --- a/src/components/user_settings/user_settings.vue +++ b/src/components/user_settings/user_settings.vue @@ -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> |
