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, { export default Component.extend(ComposerUpload, {
classNameBindings: ["showToolbar:toolbar-visible", ":wmd-controls"], classNameBindings: ["showToolbar:toolbar-visible", ":wmd-controls"],
fileUploadElementId: "file-uploader",
mobileFileUploaderId: "mobile-file-upload",
shouldBuildScrollMap: true, shouldBuildScrollMap: true,
scrollMap: null, scrollMap: null,
processPreview: true, processPreview: true,

View File

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