From a208f47b6a7d64dc56b2fec3b1bf25b7f307517d Mon Sep 17 00:00:00 2001 From: shortcutme Date: Thu, 4 Apr 2019 13:28:38 +0200 Subject: [PATCH] Fix sidebar opening for fast mouse movements --- plugins/Sidebar/media/Sidebar.coffee | 11 ++++++----- plugins/Sidebar/media/all.js | 6 +++--- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/plugins/Sidebar/media/Sidebar.coffee b/plugins/Sidebar/media/Sidebar.coffee index fb81c53f..d24d373b 100644 --- a/plugins/Sidebar/media/Sidebar.coffee +++ b/plugins/Sidebar/media/Sidebar.coffee @@ -40,11 +40,15 @@ class Sidebar extends Class # Disable previous listeners @fixbutton.off "click touchend touchcancel" - @fixbutton.off "mousemove touchmove" # Make sure its not a click @dragStarted = (+ new Date) - @fixbutton.one "mousemove touchmove", (e) => + + # Fullscreen drag bg to capture mouse events over iframe + $(".drag-bg").remove() + $("
").appendTo(document.body) + + $("body").one "mousemove touchmove", (e) => mousex = e.pageX mousey = e.pageY if not mousex @@ -80,9 +84,6 @@ class Sidebar extends Class @fixbutton.addClass("dragging") - # Fullscreen drag bg to capture mouse events over iframe - $("
").appendTo(document.body) - # IE position wrap fix if navigator.userAgent.indexOf('MSIE') != -1 or navigator.appVersion.indexOf('Trident/') > 0 @fixbutton.css("pointer-events", "none") diff --git a/plugins/Sidebar/media/all.js b/plugins/Sidebar/media/all.js index ac122782..5f5ded36 100644 --- a/plugins/Sidebar/media/all.js +++ b/plugins/Sidebar/media/all.js @@ -416,9 +416,10 @@ window.initScrollable = function () { } e.preventDefault(); _this.fixbutton.off("click touchend touchcancel"); - _this.fixbutton.off("mousemove touchmove"); _this.dragStarted = +(new Date); - return _this.fixbutton.one("mousemove touchmove", function(e) { + $(".drag-bg").remove(); + $("
").appendTo(document.body); + return $("body").one("mousemove touchmove", function(e) { var mousex, mousey; mousex = e.pageX; mousey = e.pageY; @@ -464,7 +465,6 @@ window.initScrollable = function () { this.log("startDrag"); this.fixbutton_targetx = this.fixbutton_initx; this.fixbutton.addClass("dragging"); - $("
").appendTo(document.body); if (navigator.userAgent.indexOf('MSIE') !== -1 || navigator.appVersion.indexOf('Trident/') > 0) { this.fixbutton.css("pointer-events", "none"); }