From e257f31ea59491ebd77aeb7f7c58a4e54432d1e7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jon=C3=A1=C5=A1=20Havelka?= Date: Tue, 21 Jan 2025 09:28:46 +0100 Subject: [PATCH] =?UTF-8?q?x,y=20ulo=C5=BEen=C3=A9=20v=20oprav=C4=9B=20(ne?= =?UTF-8?q?mus=C3=ADme=20tahat=20z=20=C4=8D=C3=A1ry=20(pointru))?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- korektury/static/korektury/opraf.js | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/korektury/static/korektury/opraf.js b/korektury/static/korektury/opraf.js index f566086e..dfe24684 100644 --- a/korektury/static/korektury/opraf.js +++ b/korektury/static/korektury/opraf.js @@ -46,6 +46,8 @@ function place_comments_one_div(img_id, comments) el.pointer = elp; el.img_id = img_id; + el.x = x + el.y = y el.style.position = 'absolute'; el.style.left = w + w_skip; el.style.top = y + delta_y; @@ -101,22 +103,16 @@ function toggle_visibility(oprava){ // show comment form, when 'comment' button pressed function comment(op) { - var divpointer = op.pointer; - var dx = parseInt(divpointer.style.left); - var dy = parseInt(divpointer.style.top); - return show_form(op.img_id, dx, dy, op.dataset.opid, "", "comment"); + return show_form(op.img_id, op.x, op.y, op.dataset.opid, "", "comment"); } // show comment form when 'update-comment' button pressed function update_comment(oid,ktid) { var divbox = document.getElementById(oid); - var divpointer = divbox.pointer; - var dx = parseInt(divpointer.style.left); - var dy = parseInt(divpointer.style.top); var text = document.getElementById(ktid).textContent; - return show_form(divbox.img_id, dx, dy, ktid.substring(2), text, 'update-comment'); + return show_form(divbox.img_id, divbox.x, divbox.y, ktid.substring(2), text, 'update-comment'); } function oprava_onmouseover(op)