diff --git a/korektury/static/korektury/opraf.css b/korektury/static/korektury/opraf.css index b9238953..48d7e9a3 100644 --- a/korektury/static/korektury/opraf.css +++ b/korektury/static/korektury/opraf.css @@ -33,6 +33,12 @@ img{background:white;} --rgb: 0, 255, 0; } +[data-opravazobrazit="false"] { + .corr-body { display: none; } + .corr-buttons { display: none; } + .toggle-button { transform: rotate(180deg); } +} + .pointer-hi, .pointer{ position:absolute; diff --git a/korektury/static/korektury/opraf.js b/korektury/static/korektury/opraf.js index d299b56e..7e22bfad 100644 --- a/korektury/static/korektury/opraf.js +++ b/korektury/static/korektury/opraf.js @@ -96,19 +96,8 @@ function img_click(element, ev) { return show_form(img_id, dx, dy, '', '', '', ''); } // hide or show text of correction -function toggle_visibility(oid){ - var buttondiv = document.getElementById(oid+'-buttons') - var text = document.getElementById(oid+'-body'); - var toggleimg = document.getElementById(oid+'-toggleimg'); - if (text.style.display == 'none'){ - text.style.display = 'block'; - buttondiv.style.display = 'inline-block'; - toggleimg.style.transform = ""; - }else { - text.style.display = 'none'; - buttondiv.style.display = 'none'; - toggleimg.style.transform = "rotate(180deg)"; - } +function toggle_visibility(oprava){ + oprava.dataset.opravazobrazit = oprava.dataset.opravazobrazit !== 'true'; for (var i=0;i @@ -22,7 +23,7 @@
- +
{% csrf_token %} @@ -64,8 +65,8 @@ {% endif %} -