From 157d1f8cb9b209d734bb9ba6d208eeb4ed851d04 Mon Sep 17 00:00:00 2001 From: Jeff Becker Date: Sat, 30 Apr 2016 15:13:52 -0400 Subject: [PATCH] be aware of screen size --- contrib/js/backlink.js | 9 +++++---- contrib/static/nntpchan.js | 2 +- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/contrib/js/backlink.js b/contrib/js/backlink.js index e2be8cc..b1168c4 100644 --- a/contrib/js/backlink.js +++ b/contrib/js/backlink.js @@ -280,10 +280,11 @@ function init(prefix) { e.addEventListener("dragend", function(ev) { var x = originalX + ev.clientX - mouseDownX; var y = originalY + ev.clientY - mouseDownY; - console.log(x,y); - //rpl.moveTo(x, y); - //originalX = x; - //originalY = y; + x -= window.screenLeft; + y -= window.screenTop; + rpl.moveTo(x, y); + originalX = x; + originalY = y; }, false); } diff --git a/contrib/static/nntpchan.js b/contrib/static/nntpchan.js index e8d438a..e987360 100644 --- a/contrib/static/nntpchan.js +++ b/contrib/static/nntpchan.js @@ -38,7 +38,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