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"); }