summaryrefslogtreecommitdiffstats
path: root/apps/files/js/jquery.fileupload.js
diff options
context:
space:
mode:
authorJohn Molakvoæ <skjnldsv@users.noreply.github.com>2018-06-11 09:17:48 +0200
committerGitHub <noreply@github.com>2018-06-11 09:17:48 +0200
commita1496d7cc1d9f7b29062621deddd239cc37a9194 (patch)
treef3d639b0d585947246c3feed996b4423b2c14815 /apps/files/js/jquery.fileupload.js
parent51d867c5d7580e0eee22eed1bbe65647124b90f1 (diff)
parent4eafae4178fcbd99627d9e9625b0b1f1ebe46dd5 (diff)
downloadnextcloud-server-a1496d7cc1d9f7b29062621deddd239cc37a9194.tar.gz
nextcloud-server-a1496d7cc1d9f7b29062621deddd239cc37a9194.zip
Merge pull request #9807 from nextcloud/fix-highlighting-of-the-upload-drop-zone
Fix highlighting of the upload drop zone
Diffstat (limited to 'apps/files/js/jquery.fileupload.js')
-rw-r--r--apps/files/js/jquery.fileupload.js12
1 files changed, 12 insertions, 0 deletions
diff --git a/apps/files/js/jquery.fileupload.js b/apps/files/js/jquery.fileupload.js
index 622161ede97..ea8529f3226 100644
--- a/apps/files/js/jquery.fileupload.js
+++ b/apps/files/js/jquery.fileupload.js
@@ -258,6 +258,9 @@
// Callback for drop events of the dropZone(s):
// drop: function (e, data) {}, // .bind('fileuploaddrop', func);
+ // Callback for drop events of the dropZone(s) when there are no files:
+ // dropnofiles: function (e) {}, // .bind('fileuploaddropnofiles', func);
+
// Callback for dragover events of the dropZone(s):
// dragover: function (e) {}, // .bind('fileuploaddragover', func);
@@ -1275,6 +1278,15 @@
that._onAdd(e, data);
}
});
+ } else {
+ // "dropnofiles" is triggered to allow proper cleanup of the
+ // drag and drop operation, as some browsers trigger "drop"
+ // events that have no files even if the "DataTransfer.types" of
+ // the "dragover" event included a "Files" item.
+ this._trigger(
+ 'dropnofiles',
+ $.Event('drop', {delegatedEvent: e})
+ );
}
},