X-Git-Url: https://git.sesse.net/?p=pr0n;a=blobdiff_plain;f=files%2Fpr0n-fullscreen.js;h=d9d37c6131b8226a952e95677f2991d9e404f2d2;hp=7ab77cd3155b4ad28320b4c54ed0af8121a4373f;hb=028fd7f4a56f931d04a806f4356cf27b6d18f092;hpb=86ec101a01fc0a0fdfc338251a28ee35f4a6504f diff --git a/files/pr0n-fullscreen.js b/files/pr0n-fullscreen.js index 7ab77cd..d9d37c6 100644 --- a/files/pr0n-fullscreen.js +++ b/files/pr0n-fullscreen.js @@ -381,11 +381,11 @@ function draw_text(msg) text.style.font = "24px verdana, arial, sans-serif"; text.innerHTML = msg; - var main = document.getElementById("main"); - main.appendChild(text); + document.getElementById("main").appendChild(text); - text.style.left = (main.clientWidth - text.clientWidth) / 2 + "px"; - text.style.top = (main.clientHeight - text.clientHeight) / 2 + "px"; + var screen_size = find_width(); + text.style.left = (screen_size[0] - text.clientWidth) / 2 + "px"; + text.style.top = (screen_size[1] - text.clientHeight) / 2 + "px"; } function fade_text(opacity) @@ -414,7 +414,7 @@ function select_image(evt, filename, selected) } var req = new XMLHttpRequest(); - req.open("POST", window.location.origin + "/select", false); + req.open("POST", window.location.origin + "/select", true); req.setRequestHeader("Content-type", "application/x-www-form-urlencoded"); req.send("event=" + evt + "&filename=" + filename + "&selected=" + selected); @@ -560,7 +560,6 @@ function swipe(e) var new_x = (e.changedTouches[0].pageX - swipe_start_x); set_swipe_pos(new_x, null); } - e.preventDefault(); } window.onload = function() {