nextcloud/apps/files
Daniel Calviño Sánchez bcfe8431b4 Fix progress bar hidden before the upload ends
The jQuery File Upload plugin triggers the "stop" event once there are
no more files being uploaded (even if some of them were added when
another upload was already in progress). Therefore, the progress bar
should be hidden in the "fileuploadstop" callback.

In some cases the "stop" event is not triggered and thus the progress
bar is not hidden once no more files are being uploaded. This is caused
by a race condition and it will be fixed in another commit; except in
buggy cases like that one (that need to be fixed anyway) it is safe to
hide the progress bar in the "fileuploadstop" callback.

In any case, note that the callbacks in "fileuploaddone" may be called
after the "stop" event was triggered and handled when using chunked
uploads. In that case once all the chunks are uploaded the assembled
file is moved to its final destination, so its promise could be resolved
after the "stop" event was triggered. Therefore a different approach
would be needed to keep the progress bar visible until the chunked
upload is truly finished, but for the time being the current one is good
enough.

Before this commit the progress bar was being hidden when the first
upload finished, either successfully or with an error, no matter if
there were other files being uploaded too.

The progress bar was being explicitly hidden also when the upload was
cancelled. When an upload is cancelled all the single uploads are
aborted, which triggers a "fail" event for each of them. However, the
"stop" event is always triggered when no more files are being uploaded,
so it is triggered too once all the single uploads were aborted. As all
the single uploads are immediately aborted in a loop when the general
upload is cancelled it makes no difference to hide the progress bar when
the first single upload is aborted or when all the single uploads were
aborted, so the progress bar is no longer explicitly hidden in the
former case.

Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
2018-04-05 11:12:33 +02:00
..
ajax Move calls to \OCP\JSON to private \OC_JSON 2018-03-22 13:19:29 +01:00
appinfo Remove unused download.php 2018-03-19 11:45:48 +01:00
composer Move storagestats endpoint to proper controller 2018-03-13 12:44:48 +01:00
css Fixed tooltip positionning & error display 2018-03-07 13:17:37 +01:00
img Add some whitespace around change.svg icon 2018-02-22 15:46:21 +01:00
js Fix progress bar hidden before the upload ends 2018-04-05 11:12:33 +02:00
l10n [tx-robot] updated from transifex 2018-04-04 00:13:26 +00:00
lib Move storagestats endpoint to proper controller 2018-03-13 12:44:48 +01:00
templates Split move and copy operations 2018-02-15 18:51:12 +01:00
tests Fixed jsunit 2018-03-08 10:31:33 +01:00
list.php Remove upload_limit in files app as it is not needed with PUT upload (#26069) 2016-11-02 20:43:35 +01:00
recentlist.php Change @georgehrke's email 2017-11-06 20:38:59 +01:00
simplelist.php Fix apps/ 2016-07-21 18:13:57 +02:00