Details
Assignee
UnassignedUnassignedReporter
Gregor MossGregor MossPriority
Major
Details
Details
Assignee
Unassigned
UnassignedReporter
Gregor Moss
Gregor MossPriority
Created May 31, 2018 at 7:41 PM
Updated May 31, 2018 at 7:41 PM
Resolved May 31, 2018 at 7:41 PM
The singleFileUploader grade uses hidden upload form elements to allow custom upload behaviour. The main implementation of this currently is the imageBlockEditor, which has up to two of them, one for file image upload, another for camera upload (on mobile).
The similar event names of "imageUploadRequested" on the imageBlockEditor and "onUploadRequested" on singleFileUploader creates some confusion about what component is responsible for what. Capturing this here:
"imageUploadRequested" simply captures the intent of the user clicking the "Upload Image" button.
the singleFileUploader subcomponent of imageBlockEditor listens to the prior event to fire its own "onUploadRequested" event; this is listened to and then clicks the hidden file input to actually open the uploader dialogue.
This level of indirection may be excessive and confusing. We should consider whether it would be more appropriate to have an invoker on singleFileUploader called "doUpload" or similar that would continue to "hide" specific implementation details, but be callable by another component.