From 7b3a6329a6aff9e61d05aaaa65bb4d3e5e87652d Mon Sep 17 00:00:00 2001 From: Jeff Date: Tue, 3 May 2016 14:02:13 -0400 Subject: [PATCH] try fix --- contrib/js/reply.js | 13 ++++++++----- contrib/static/nntpchan.js | 2 +- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/contrib/js/reply.js b/contrib/js/reply.js index 0498d5e..9026b4d 100644 --- a/contrib/js/reply.js +++ b/contrib/js/reply.js @@ -366,9 +366,9 @@ function init(prefix) { var e = rpl.elem; var mouseDownX, mouseDownY; - var originalX = window.screenX - 50; - var originalY = 10; - rpl.moveTo(originalX, originalY); + var ox = window.screenX - 50; + var oy = 10; + rpl.moveTo(ox, oy); e.setAttribute("draggable", "true"); @@ -382,10 +382,13 @@ function init(prefix) { }, false); e.addEventListener("dragend", function(ev) { - var dx = ev.screenX - mouseDownX; - var dy = ev.screenY - mouseDownY; + var dx = ox + ev.screenX - mouseDownX; + var dy = oy + ev.screenY - mouseDownY; + console.log(dx, dy); rpl.translate(dx, dy); + ox = rpl.x; + oy = rpl.y; }, false); // add replyto post handlers diff --git a/contrib/static/nntpchan.js b/contrib/static/nntpchan.js index b9ef3a8..12b3b3e 100644 --- a/contrib/static/nntpchan.js +++ b/contrib/static/nntpchan.js @@ -82,7 +82,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