Toggle Add Video(s) buttons during upload when using Chunkuploader #411
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR fixes #308
Description
When uploading a large file, it might take some times until the file is 100% upload in both Moodle file picker element or Chunkuploader. During upload, if the add video button is accidentally pressed, the upload is going to be perform but with incompleted files which ends up with broken episode etc.
For that there was already the add video button (Disable/Enable) feature when drag and drop files into the Moodle basic file picker element, but the feature was missing for the chunkuploader.
Solution
This PR now provides the disable/enalbe feature of the add video button also for chunkuploader, by watching the progressbar of the chunkuploader block during upload!
Note to the initial request:
The inital issue requested a cancel button during upload, which is not possible to implement because Moodle itself does not provide a standard way. Therefore, in favor of avoiding complexity this part of the request is denied!