DEV: Set composer upload btn selectors in component (#14324)

This commit is contained in:
Mark VanLandingham 2021-09-17 13:06:31 -05:00 committed by GitHub
parent cb0b39d16e
commit cb1210da35
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 3 deletions

View File

@ -90,6 +90,8 @@ export function cleanUpComposerUploadMarkdownResolver() {
export default Component.extend(ComposerUpload, {
classNameBindings: ["showToolbar:toolbar-visible", ":wmd-controls"],
fileUploadElementId: "file-uploader",
mobileFileUploaderId: "mobile-file-upload",
shouldBuildScrollMap: true,
scrollMap: null,
processPreview: true,

View File

@ -331,9 +331,11 @@ export default Mixin.create({
_bindMobileUploadButton() {
if (this.site.mobileView) {
this.mobileUploadButton = document.getElementById("mobile-file-upload");
this.mobileUploadButtonEventListener = function mobileButtonEventListener() {
document.getElementById("file-uploader").click();
this.mobileUploadButton = document.getElementById(
this.mobileFileUploaderId
);
this.mobileUploadButtonEventListener = () => {
document.getElementById(this.fileUploadElementId).click();
};
this.mobileUploadButton.addEventListener(
"click",