diff --git a/korektury/static/korektury/opraf.js b/korektury/static/korektury/opraf.js index d4982f29..78cee8d2 100644 --- a/korektury/static/korektury/opraf.js +++ b/korektury/static/korektury/opraf.js @@ -99,13 +99,13 @@ function toggle_visibility(oprava){ } // show comment form, when 'edit' or 'comment' button pressed -function box_edit(oid, action) +function box_edit(op, action) { - var divpointer = document.getElementById(oid + '-pointer'); + var divpointer = document.getElementById(op.id + '-pointer'); var text; if (action == 'update') { - var text_el = document.getElementById(oid + '-text'); + var text_el = document.getElementById(op.id + '-text'); text = text_el.textContent; } else { @@ -114,9 +114,7 @@ function box_edit(oid, action) var dx = parseInt(divpointer.style.left); var dy = parseInt(divpointer.style.top); - var divbox = document.getElementById(oid); - id = oid.substring(2); - return show_form(divbox.img_id, dx, dy, id, text, action); + return show_form(op.img_id, dx, dy, op.dataset.opid, text, action); } // show comment form when 'update-comment' button pressed diff --git a/korektury/templates/korektury/korekturovatko/__oprava.html b/korektury/templates/korektury/korekturovatko/__oprava.html index 361c5a77..a2a9bbce 100644 --- a/korektury/templates/korektury/korekturovatko/__oprava.html +++ b/korektury/templates/korektury/korekturovatko/__oprava.html @@ -10,6 +10,7 @@ class='box' data-opravastatus="{{o.status}}" data-opravazobrazit="true" + data-opid="{{o.id}}" onmouseover='box_onmouseover(this)' onmouseout='box_onmouseout(this)' > @@ -48,7 +49,7 @@ -