Lazily bind Signal.Components.MediaGallery

This commit is contained in:
Daniel Gasienica 2018-04-15 02:52:33 -04:00
parent 146178f977
commit 204de3aaea

View file

@ -16,8 +16,6 @@
window.Whisper = window.Whisper || {};
const { MediaGallery } = window.Signal.Components;
Whisper.ExpiredToast = Whisper.ToastView.extend({
render_attributes() {
return { toastMessage: i18n('expiredWarning') };
@ -610,7 +608,7 @@
};
const view = new Whisper.ReactWrapperView({
Component: MediaGallery,
Component: Signal.Components.MediaGallery,
props: mediaGalleryProps,
onClose: () => this.resetPanel(),
});
@ -675,35 +673,6 @@
}
},
viewAllMedia() {
// We have to do this manually, since our React component will not propagate click
// events up to its parent elements in the DOM.
this.closeMenu();
// Next:
// pull latest media
// need a way for react component to request further data
// needed components:
// GalleryPanel
// Section - header, list of thumbnails
// Thumbnail
// Lightbox - or do we use the lightbox already in the app?
const props = {
media: [],
documents: [],
};
const view = new window.Whisper.ReactWrapper({
Component: MediaGallery,
props,
onClose: () => this.resetPanel(),
});
this.listenBack(view);
},
focusMessageField() {
this.$messageField.focus();
},