From 7527e4c978ca60a60a0a68ca47511cd1b7094bab Mon Sep 17 00:00:00 2001 From: Jeff Becker Date: Sat, 30 Apr 2016 14:52:19 -0400 Subject: [PATCH] try fixing drag to move again --- contrib/js/backlink.js | 13 ++++++++----- contrib/static/nntpchan.js | 4 ++-- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/contrib/js/backlink.js b/contrib/js/backlink.js index 227bb0f..890efea 100644 --- a/contrib/js/backlink.js +++ b/contrib/js/backlink.js @@ -272,19 +272,22 @@ function init(prefix) { var originalY = 10; rpl.moveTo(originalX, originalY); - e.addEventListener("mousedown", function(ev) { + e.addEventListener("dragstart", function(ev) { mouseDownX = ev.clientX; mouseDownY = ev.clientY; ev.stopPropagation(); - }); + ev.preventDefault(); + + }, false); - e.addEventListener("mouseup", function(ev) { - ev.stopPropagation(); + e.addEventListener("dragend", function(ev) { var x = originalX + ev.clientX - mouseDownX var y = originalY + ev.clientY - mouseDownY rpl.moveTo(x, y); originalX = x; originalY = y; - }); + ev.stopPropagation(); + ev.preventDefault(); + }, false); } diff --git a/contrib/static/nntpchan.js b/contrib/static/nntpchan.js index 4046e86..ff37f99 100644 --- a/contrib/static/nntpchan.js +++ b/contrib/static/nntpchan.js @@ -38,9 +38,9 @@ parent.appendChild(wrapper);parent.backlink=false;},function(msg){var wrapper=do parent.backlink=true;}};parent.backlink=true;} function inject_hover_for_element(elem){var elems=elem.getElementsByClassName("backlink");var ls=[];var l=elems.length;for(var idx=0;idx