Improve caption editor usability, new 'add attachment' affordance
This commit is contained in:
parent
ac1a6d197a
commit
0de54e125c
14 changed files with 224 additions and 61 deletions
|
@ -86,6 +86,7 @@
|
|||
|
||||
return {
|
||||
attachments,
|
||||
onAddAttachment: this.onAddAttachment.bind(this),
|
||||
onClickAttachment: this.onClickAttachment.bind(this),
|
||||
onCloseAttachment: this.onCloseAttachment.bind(this),
|
||||
onClose: this.onClose.bind(this),
|
||||
|
@ -97,18 +98,15 @@
|
|||
url: attachment.videoUrl || attachment.url,
|
||||
caption: attachment.caption,
|
||||
attachment,
|
||||
onChangeCaption,
|
||||
onSave,
|
||||
});
|
||||
|
||||
const update = () => {
|
||||
this.captionEditorView.update(getProps());
|
||||
};
|
||||
|
||||
const onChangeCaption = caption => {
|
||||
const onSave = caption => {
|
||||
// eslint-disable-next-line no-param-reassign
|
||||
attachment.caption = caption;
|
||||
this.captionEditorView.remove();
|
||||
Signal.Backbone.Views.Lightbox.hide();
|
||||
this.render();
|
||||
update();
|
||||
};
|
||||
|
||||
this.captionEditorView = new Whisper.ReactWrapperView({
|
||||
|
@ -126,6 +124,10 @@
|
|||
this.render();
|
||||
},
|
||||
|
||||
onAddAttachment() {
|
||||
this.trigger('choose-attachment');
|
||||
},
|
||||
|
||||
onClose() {
|
||||
this.attachments = [];
|
||||
this.trigger('attachments-changed');
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue