From ad1ff687f6678e7caa643832e4e23b48a3ef5e3b Mon Sep 17 00:00:00 2001 From: Jeff Becker Date: Sat, 30 Apr 2016 13:27:54 -0400 Subject: [PATCH] try fixing drag to move --- contrib/js/backlink.js | 6 ++---- contrib/static/nntpchan.js | 2 +- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/contrib/js/backlink.js b/contrib/js/backlink.js index c077469..73a8dd8 100644 --- a/contrib/js/backlink.js +++ b/contrib/js/backlink.js @@ -263,11 +263,9 @@ function init(prefix) { var e = rpl.elem; e.setAttribute("draggable", "true"); e.ondragend = function(ev) { - var el = document.getElementById("postform_container"); - el.style.top = "" + ev.y; - el.style.left = "" + ev.x; - console.log(el); ev.preventDefault(); + var el = document.getElementById("postform_container"); + el.setAttribute("style", "top: "+ev.y+"; left: "+ev.x); } } diff --git a/contrib/static/nntpchan.js b/contrib/static/nntpchan.js index d9f9389..02cf347 100644 --- a/contrib/static/nntpchan.js +++ b/contrib/static/nntpchan.js @@ -37,7 +37,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