diff options
author | Daniel Calviño Sánchez <danxuliu@gmail.com> | 2018-06-08 20:07:19 +0300 |
---|---|---|
committer | Daniel Calviño Sánchez <danxuliu@gmail.com> | 2018-06-08 21:01:41 +0300 |
commit | 463d92c339a9e87032e07342bbeb9198f4d8c804 (patch) | |
tree | c3efd0f25b6b92578f64a4260edba4a1ce08ea29 /apps/files | |
parent | d8251344c1677ee3e6a60695291304c844c66377 (diff) |
Remove no longer needed special handling for Firefox
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 <danxuliu@gmail.com>
Diffstat (limited to 'apps/files')
-rw-r--r-- | apps/files/js/file-upload.js | 23 |
1 files changed, 8 insertions, 15 deletions
diff --git a/apps/files/js/file-upload.js b/apps/files/js/file-upload.js index 4244bd673d6..dc412c10d76 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 |