aboutsummaryrefslogtreecommitdiffstats
path: root/apps/files/js
diff options
context:
space:
mode:
Diffstat (limited to 'apps/files/js')
-rw-r--r--apps/files/js/file-upload.js10
1 files changed, 10 insertions, 0 deletions
diff --git a/apps/files/js/file-upload.js b/apps/files/js/file-upload.js
index dc412c10d76..fac086c3da8 100644
--- a/apps/files/js/file-upload.js
+++ b/apps/files/js/file-upload.js
@@ -1041,6 +1041,8 @@ OC.Uploader.prototype = _.extend({
//remaining time
var lastUpdate, lastSize, bufferSize, buffer, bufferIndex, bufferIndex2, bufferTotal;
+ var dragging = false;
+
// add progress handlers
fileupload.on('fileuploadadd', function(e, data) {
self.log('progress handle fileuploadadd', e, data);
@@ -1148,6 +1150,8 @@ OC.Uploader.prototype = _.extend({
filerow.addClass('dropping-to-dir');
filerow.find('.thumbnail').addClass('icon-filetype-folder-drag-accept');
}
+
+ dragging = true;
});
var disableDropState = function() {
@@ -1155,6 +1159,8 @@ OC.Uploader.prototype = _.extend({
$('.dropping-to-dir').removeClass('dropping-to-dir');
$('.dir-drop').removeClass('dir-drop');
$('.icon-filetype-folder-drag-accept').removeClass('icon-filetype-folder-drag-accept');
+
+ dragging = false;
};
fileupload.on('fileuploaddragleave fileuploaddrop', disableDropState);
@@ -1164,6 +1170,10 @@ OC.Uploader.prototype = _.extend({
// file was being dragged (and thus caused "fileuploaddragover"
// to be triggered).
fileupload.on('fileuploaddropnofiles', function() {
+ if (!dragging) {
+ return;
+ }
+
disableDropState();
OC.Notification.show(t('files', 'Uploading that item is not supported'), {type: 'error'});