From 2bcd5d35c0e27e6400c96b500d2ca334808dbb0b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julius=20H=C3=A4rtl?= Date: Wed, 13 Jun 2018 18:57:44 +0200 Subject: [PATCH] Fix chrome hovering bug MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Julius Härtl --- js/app/Config.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/js/app/Config.js b/js/app/Config.js index b6fa53b29..c0039d4ad 100644 --- a/js/app/Config.js +++ b/js/app/Config.js @@ -90,9 +90,15 @@ app.config(function ($provide, $interpolateProvider, $httpProvider, $urlRouterPr return function (scope, element, attrs) { var overClass = attrs.overClass || 'nv-file-over'; link.apply(this, arguments); + let counter = 0; + element.on('dragenter', function (event) { + counter++; + }); element.on('dragleave', function (event) { - element.removeClass(overClass); - event.stopPropagation(); + counter--; + if (counter <= 0) { + $('.' + overClass).removeClass(overClass); + } }); }; };