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)