diff options
| author | Xeltica <7106976+Xeltica@users.noreply.github.com> | 2019-07-28 05:33:12 +0900 |
|---|---|---|
| committer | syuilo <Syuilotan@yahoo.co.jp> | 2019-07-28 05:33:12 +0900 |
| commit | 831ca53b639062efd5a6e3e7c1b0b20f46ce6fc1 (patch) | |
| tree | a38174385bdbec40915363a40de6c71d76bce1c6 /src/client/app/common/scripts | |
| parent | AP Emojiのupdatedは採用しないように (#5220) (diff) | |
| download | misskey-831ca53b639062efd5a6e3e7c1b0b20f46ce6fc1.tar.gz misskey-831ca53b639062efd5a6e3e7c1b0b20f46ce6fc1.tar.bz2 misskey-831ca53b639062efd5a6e3e7c1b0b20f46ce6fc1.zip | |
「削除して編集」機能を追加 (#5182)
* 「削除して編集」機能を追加
* UXの調整
* 殆どの情報を保持したまま編集できるように
* update lang
Diffstat (limited to 'src/client/app/common/scripts')
| -rw-r--r-- | src/client/app/common/scripts/post-form.ts | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/src/client/app/common/scripts/post-form.ts b/src/client/app/common/scripts/post-form.ts index ff3fd0792b..2b591ac659 100644 --- a/src/client/app/common/scripts/post-form.ts +++ b/src/client/app/common/scripts/post-form.ts @@ -35,6 +35,10 @@ export default (opts) => ({ type: String, required: false }, + initialNote: { + type: Object, + required: false + }, instant: { type: Boolean, required: false, @@ -195,6 +199,28 @@ export default (opts) => ({ this.$emit('change-attached-files', this.files); } } + if (this.initialNote) { + // 削除して編集 + const init = this.initialNote; + this.text = init.text ? init.text : ''; + this.files = init.files; + this.cw = init.cw; + this.useCw = init.cw != null; + if (init.poll) { + this.poll = true; + this.$nextTick(() => { + (this.$refs.poll as any).set({ + choices: init.poll.choices.map(c => c.text), + multiple: init.poll.multiple + }); + }); + } + // hack 位置情報投稿が動くようになったら適用する + this.geo = null; + this.visibility = init.visibility; + this.localOnly = init.localOnly; + this.quoteId = init.renote ? init.renote.id : null; + } this.$nextTick(() => this.watch()); }); |