|
195 | 195 | <button class="no-animate send" v-if="editorConvoMode" @click.prevent="createAction(newMessage).then(closeEditor);" :disabled="!canCreate() || !newMessage.content.body.length || !newMessage.content.subject.length || !newMessage.receiver_ids.length"> |
196 | 196 | <i class="fa fa-paper-plane" aria-hidden="true"></i> Send |
197 | 197 | </button> |
198 | | - <button class="no-animate send" v-if="!editorConvoMode" @click.prevent="updateAction().then(closeEditor);" :disabled="!canUpdate() || !newMessage.content.body.length"> |
| 198 | + <button class="no-animate send" v-if="!editorConvoMode" @click.prevent="updateAction(newMessage).then(closeEditor);" :disabled="!canUpdate() || !newMessage.content.body.length"> |
199 | 199 | <i class="fa fa-paper-plane" aria-hidden="true"></i> Send Reply |
200 | 200 | </button> |
201 | 201 |
|
@@ -238,7 +238,7 @@ import Multiselect from '@vueform/multiselect' |
238 | 238 | import { usersApi } from '@/api' |
239 | 239 |
|
240 | 240 | export default { |
241 | | - props: ['editorConvoMode', 'threadEditorMode', 'postEditorMode', 'createAction', 'updateAction', 'showEditor', 'thread' ], |
| 241 | + props: ['editorConvoMode', 'threadEditorMode', 'postEditorMode', 'createAction', 'updateAction', 'showEditor', 'thread', 'currentMessage' ], |
242 | 242 | emits: ['close'], |
243 | 243 | components: { ImageUploader, Multiselect }, |
244 | 244 | setup(props, { emit }) { |
@@ -272,7 +272,7 @@ export default { |
272 | 272 | draftStatus: null, |
273 | 273 | postMaxLength: window.post_max_length, |
274 | 274 | posting: { post: { title: '', body: '', thread_id: props?.thread?.id } }, |
275 | | - newMessage: { receiver_ids: [], content: { subject: '', body: '' } }, |
| 275 | + newMessage: { receiver_ids: [], conversation_id: null, content: { subject: '', body: '' } }, |
276 | 276 | rightToLeft: false, |
277 | 277 | threadTitleEl: null, |
278 | 278 | msgTagsInput: { |
@@ -304,6 +304,10 @@ export default { |
304 | 304 | watch(() => props.showEditor, visible => { |
305 | 305 | console.log(visible, props.threadEditorMode) |
306 | 306 | if (visible && props.threadEditorMode) nextTick(() => v.threadTitleEl.focus()) |
| 307 | + if (visible && props.currentMessage) { |
| 308 | + v.newMessage = props.currentMessage |
| 309 | + console.log(v.newMessage) |
| 310 | + } |
307 | 311 | }) |
308 | 312 |
|
309 | 313 | return { ...toRefs(v), canLock, canCreate, canUpdate, canSticky, canModerate, canCreatePoll, cancel, closeEditor } |
|
0 commit comments