From 463d92c339a9e87032e07342bbeb9198f4d8c804 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Calvi=C3=B1o=20S=C3=A1nchez?= Date: Fri, 8 Jun 2018 19:07:19 +0200 Subject: [PATCH] Remove no longer needed special handling for Firefox MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The highlighting was removed in Firefox when the cursor was no longer moving to handle the behaviour of reporting a file drag and then providing no files in the drop event. That behaviour (which was only present in Firefox 48 and 49) is already handled with the "dropnofiles" callback, so that special handling is no longer needed. Signed-off-by: Daniel Calviño Sánchez --- apps/files/js/file-upload.js | 23 ++++++++--------------- 1 file changed, 8 insertions(+), 15 deletions(-) diff --git a/apps/files/js/file-upload.js b/apps/files/js/file-upload.js index 4244bd673d..dc412c10d7 100644 --- a/apps/files/js/file-upload.js +++ b/apps/files/js/file-upload.js @@ -1131,23 +1131,8 @@ OC.Uploader.prototype = _.extend({ self.log('progress handle fileuploadfail', e, data); self.trigger('fail', e, data); }); - var disableDropState = function() { - $('#app-content').removeClass('file-drag'); - $('.dropping-to-dir').removeClass('dropping-to-dir'); - $('.dir-drop').removeClass('dir-drop'); - $('.icon-filetype-folder-drag-accept').removeClass('icon-filetype-folder-drag-accept'); - }; - var disableClassOnFirefox = _.debounce(function() { - disableDropState(); - }, 100); fileupload.on('fileuploaddragover', function(e){ $('#app-content').addClass('file-drag'); - // dropping a folder in firefox doesn't cause a drop event - // this is simulated by simply invoke disabling all classes - // once no dragover event isn't noticed anymore - if (/Firefox/i.test(navigator.userAgent)) { - disableClassOnFirefox(); - } $('#emptycontent .icon-folder').addClass('icon-filetype-folder-drag-accept'); var filerow = $(e.delegatedEvent.target).closest('tr'); @@ -1164,6 +1149,14 @@ OC.Uploader.prototype = _.extend({ filerow.find('.thumbnail').addClass('icon-filetype-folder-drag-accept'); } }); + + var disableDropState = function() { + $('#app-content').removeClass('file-drag'); + $('.dropping-to-dir').removeClass('dropping-to-dir'); + $('.dir-drop').removeClass('dir-drop'); + $('.icon-filetype-folder-drag-accept').removeClass('icon-filetype-folder-drag-accept'); + }; + fileupload.on('fileuploaddragleave fileuploaddrop', disableDropState); // In some browsers the "drop" event can be triggered with no