Fix sidebar opening for fast mouse movements
This commit is contained in:
parent
84268cd43c
commit
a208f47b6a
2 changed files with 9 additions and 8 deletions
|
@ -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()
|
||||
$("<div class='drag-bg'></div>").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
|
||||
$("<div class='drag-bg'></div>").appendTo(document.body)
|
||||
|
||||
# IE position wrap fix
|
||||
if navigator.userAgent.indexOf('MSIE') != -1 or navigator.appVersion.indexOf('Trident/') > 0
|
||||
@fixbutton.css("pointer-events", "none")
|
||||
|
|
|
@ -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();
|
||||
$("<div class='drag-bg'></div>").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");
|
||||
$("<div class='drag-bg'></div>").appendTo(document.body);
|
||||
if (navigator.userAgent.indexOf('MSIE') !== -1 || navigator.appVersion.indexOf('Trident/') > 0) {
|
||||
this.fixbutton.css("pointer-events", "none");
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue