From 521c1354986de44929ccbd75d2d0b82796117191 Mon Sep 17 00:00:00 2001 From: Jeff Date: Tue, 3 May 2016 15:04:38 -0400 Subject: [PATCH] use stack overflow example --- contrib/js/reply.js | 6 ++++-- contrib/static/nntpchan.js | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/contrib/js/reply.js b/contrib/js/reply.js index 9d426d6..eadc1fc 100644 --- a/contrib/js/reply.js +++ b/contrib/js/reply.js @@ -387,9 +387,11 @@ function init(prefix) { $(rpl.elem).on("mousemove", function(ev) { if ($dragging) { + var x = ev.pageX - $(this).width() / 2, + y = ev.pageY - $(this).height() / 2; $dragging.offset({ - top: ev.pageY, - left: ev.pageX + top: x, + left: y }); } }); diff --git a/contrib/static/nntpchan.js b/contrib/static/nntpchan.js index f979594..a51b831 100644 --- a/contrib/static/nntpchan.js +++ b/contrib/static/nntpchan.js @@ -691,7 +691,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