From 00e0ed0a5047a73630515278c396b04f6656b4f5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jon=C3=A1=C5=A1=20Havelka?= Date: Mon, 20 Jan 2025 21:45:37 +0100 Subject: [PATCH] =?UTF-8?q?Skr=C3=BDv=C3=A1n=C3=AD=20korektur=20pomoc?= =?UTF-8?q?=C3=AD=20atributu?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- korektury/static/korektury/opraf.css | 6 ++++++ korektury/static/korektury/opraf.js | 15 ++------------- .../korektury/korekturovatko/__oprava.html | 7 ++++--- 3 files changed, 12 insertions(+), 16 deletions(-) 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 %} -