From d99d2581aaaa01482410dfb5d885b7f2efde058c Mon Sep 17 00:00:00 2001 From: Shawn Bruce Date: Tue, 12 May 2020 22:48:17 -0400 Subject: [PATCH] Workaround for #2166 is no longer required as of Firefox 57.0.2 --- .../static/js/app/viewmodels/files.js | 29 ------------------- 1 file changed, 29 deletions(-) diff --git a/src/octoprint/static/js/app/viewmodels/files.js b/src/octoprint/static/js/app/viewmodels/files.js index 704ed3020..d1f75560e 100644 --- a/src/octoprint/static/js/app/viewmodels/files.js +++ b/src/octoprint/static/js/app/viewmodels/files.js @@ -1124,12 +1124,10 @@ $(function() { if (enable) { $(document).bind("dragenter", self._handleDragEnter); $(document).bind("dragleave", self._handleDragLeave); - $(document).bind("dragover", self._handleDragOver); log.debug("Enabled drag-n-drop"); } else { $(document).unbind("dragenter", self._handleDragEnter); $(document).unbind("dragleave", self._handleDragLeave); - $(document).unbind("dragover", self._handleDragOver); log.debug("Disabled drag-n-drop"); } }; @@ -1220,33 +1218,6 @@ $(function() { self._forceEndDragNDrop(); }; - self._handleDragOver = function(e) { - // Workaround for Firefox - // - // Due to a browser bug (https://bugzilla.mozilla.org/show_bug.cgi?id=656164), - // if you drag a file out of the window no drag leave event will be fired. So on Firefox we check if - // our last dragover event was within a timeout. If not, we assume that's because the mouse - // cursor left the browser window and force a drag stop. - // - // Since Firefox keeps on triggering dragover events even if the mouse is not moved while over the - // browser window, this should work without side effects (e.g. the overlay should stay even if the user - // keeps the mouse perfectly still). - // - // See #2166 - if (!OctoPrint.coreui.browser.firefox) return; - if (e.target !== self._dragNDropTarget) return; - - if (self._dragNDropFFTimeout !== undefined) { - window.clearTimeout(self._dragNDropFFTimeout); - self._dragNDropFFTimeout = undefined; - } - - self._dragNDropFFTimeout = window.setTimeout(function() { - self._forceEndDragNDrop(); - self._dragNDropFFTimeout = undefined; - }, self._dragNDropFFTimeoutDelay); - }; - self._handleDragEnter = function (e) { self.dropOverlay.addClass('in');