From def0a4a5c50b6abe5c14360ddba5a4a410410432 Mon Sep 17 00:00:00 2001 From: Jeff Date: Tue, 3 May 2016 12:33:24 -0400 Subject: [PATCH] adgo back to drag events --- contrib/js/reply.js | 15 ++++++--------- contrib/static/nntpchan.js | 2 +- 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/contrib/js/reply.js b/contrib/js/reply.js index 45f32c8..4754199 100644 --- a/contrib/js/reply.js +++ b/contrib/js/reply.js @@ -359,26 +359,23 @@ function init(prefix) { var originalY = 10; rpl.moveTo(originalX, originalY); - var mousedown = false; + e.setAttribute("draggable", "true"); - e.addEventListener("mousedown", function(ev) { + e.addEventListener("dragstart", function(ev) { console.log(ev); mousedown = true; mouseDownX = ev.clientX; mouseDownY = ev.clientY; }, false); - e.addEventListener("mouseup", function(ev) { + e.addEventListener("dragend", function(ev) { var x = originalX + ev.clientX - mouseDownX; var y = originalY + ev.clientY - mouseDownY; x -= window.screenLeft; y -= window.screenTop; - if (mousedown) { - rpl.moveTo(x, y); - originalX = x; - originalY = y; - mousedown = false; - } + rpl.moveTo(x, y); + originalX = x; + originalY = y; }, false); // add replyto post handlers diff --git a/contrib/static/nntpchan.js b/contrib/static/nntpchan.js index 180686f..e96e234 100644 --- a/contrib/static/nntpchan.js +++ b/contrib/static/nntpchan.js @@ -81,7 +81,7 @@ 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