From 7914168502327925cb3e2f77efad49b3ee3cc526 Mon Sep 17 00:00:00 2001 From: Hadi Nategh Date: Tue, 1 Oct 2019 16:53:09 +0200 Subject: [PATCH] Remove drag enter/leave counter as it will break dragover class in FF --- api/js/Resumable/resumable.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/api/js/Resumable/resumable.js b/api/js/Resumable/resumable.js index f46bd6e752..6768a3ca92 100644 --- a/api/js/Resumable/resumable.js +++ b/api/js/Resumable/resumable.js @@ -231,9 +231,8 @@ loadFiles(e.dataTransfer.files, e); } }; - var counterDrag = 0; var onDragLeave = function(e){ - if (--counterDrag == 0) e.currentTarget.classList.remove($.getOpt('dragOverClass')); + e.currentTarget.classList.remove($.getOpt('dragOverClass')); }; var onDragOverEnter = function(e) { e.preventDefault(); @@ -242,7 +241,7 @@ e.stopPropagation(); dt.dropEffect = "copy"; dt.effectAllowed = "copy"; - if (e.type == 'dragenter' && counterDrag++ === 0) e.currentTarget.classList.add($.getOpt('dragOverClass')); + e.currentTarget.classList.add($.getOpt('dragOverClass')); } else { // not work on IE/Edge.... dt.dropEffect = "none"; dt.effectAllowed = "none"; @@ -1170,4 +1169,4 @@ window.Resumable = Resumable; } -})(); +})(); \ No newline at end of file