nextcloud-server/apps/files/js
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
..
templates
admin.js
app.js Enable chunking for bigger files in authenticated web upload 2017-11-03 17:19:23 +01:00
breadcrumb.js Merge pull request #8588 from nextcloud/fix-breadcrumbs-width-calculation 2018-03-01 20:13:26 +01:00
detailfileinfoview.js
detailsview.js Remove unused variables 2017-11-06 09:43:45 +01:00
detailtabview.js
favoritesfilelist.js Remove unused variables 2017-11-06 09:43:45 +01:00
favoritesplugin.js
file-upload.js Fix progress bar hidden before the upload ends 2018-04-05 11:12:33 +02:00
fileactions.js Fixed files copy/move when in favorites or recent section 2018-03-22 18:09:30 +01:00
fileactionsmenu.js Add support to FileActionsMenu for icon class functions 2017-10-19 01:46:13 +02:00
fileinfomodel.js
filelist.js Fixed files copy/move when in favorites or recent section 2018-03-22 18:09:30 +01:00
files.js Fixup! removed unwanted line 2018-01-03 17:55:53 +01:00
filesummary.js
gotoplugin.js Fix closing details view when viewing file in folder 2017-04-25 17:45:42 +02:00
jquery-visibility.js
jquery.fileupload.js
keyboardshortcuts.js
mainfileinfodetailview.js Hide favourite icon in details view if favourite action is not available 2018-01-05 19:06:06 +01:00
merged-index.json Merge file view JS files 2017-03-24 19:42:22 +01:00
navigation.js Only set the active item when there is one (not the case for quota) 2017-06-13 11:17:44 +02:00
newfilemenu.js Fixed event propagation on safari 2018-03-07 17:10:46 +01:00
recentfilelist.js
recentplugin.js
search.js Use proper mime icons for search results 2017-05-16 14:30:49 +02:00
sidebarpreviewmanager.js Make filelist and sidebar use the fileid preview endpoint 2018-01-24 11:24:18 +01:00
sidebarpreviewtext.js Do not fetch the whole text file for the sidebar preview 2017-08-03 20:32:59 +02:00
tagsplugin.js Remove requeriment for read permission on some actions 2017-11-02 19:37:01 +01:00
upload.js