Skrývání korektur pomocí atributu
This commit is contained in:
parent
5563eb681c
commit
00e0ed0a50
3 changed files with 12 additions and 16 deletions
|
@ -33,6 +33,12 @@ img{background:white;}
|
||||||
--rgb: 0, 255, 0;
|
--rgb: 0, 255, 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[data-opravazobrazit="false"] {
|
||||||
|
.corr-body { display: none; }
|
||||||
|
.corr-buttons { display: none; }
|
||||||
|
.toggle-button { transform: rotate(180deg); }
|
||||||
|
}
|
||||||
|
|
||||||
.pointer-hi,
|
.pointer-hi,
|
||||||
.pointer{
|
.pointer{
|
||||||
position:absolute;
|
position:absolute;
|
||||||
|
|
|
@ -96,19 +96,8 @@ function img_click(element, ev) {
|
||||||
return show_form(img_id, dx, dy, '', '', '', '');
|
return show_form(img_id, dx, dy, '', '', '', '');
|
||||||
}
|
}
|
||||||
// hide or show text of correction
|
// hide or show text of correction
|
||||||
function toggle_visibility(oid){
|
function toggle_visibility(oprava){
|
||||||
var buttondiv = document.getElementById(oid+'-buttons')
|
oprava.dataset.opravazobrazit = oprava.dataset.opravazobrazit !== 'true';
|
||||||
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)";
|
|
||||||
}
|
|
||||||
for (var i=0;i<comments.length-1;i++){
|
for (var i=0;i<comments.length-1;i++){
|
||||||
place_comments_one_div(comments[i][0], comments[i][1])
|
place_comments_one_div(comments[i][0], comments[i][1])
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,6 +9,7 @@
|
||||||
<div name='op{{o.id}}' id='op{{o.id}}'
|
<div name='op{{o.id}}' id='op{{o.id}}'
|
||||||
class='box'
|
class='box'
|
||||||
data-opravastatus="{{o.status}}"
|
data-opravastatus="{{o.status}}"
|
||||||
|
data-opravazobrazit="true"
|
||||||
onmouseover='box_onmouseover(this)'
|
onmouseover='box_onmouseover(this)'
|
||||||
onmouseout='box_onmouseout(this)'
|
onmouseout='box_onmouseout(this)'
|
||||||
>
|
>
|
||||||
|
@ -22,7 +23,7 @@
|
||||||
</div>
|
</div>
|
||||||
<div class='corr-header'>
|
<div class='corr-header'>
|
||||||
<span class='float-right'>
|
<span class='float-right'>
|
||||||
<span id='op{{o.id}}-buttons'>
|
<span id='op{{o.id}}-buttons' class='corr-buttons'>
|
||||||
<form action='' method='POST'>
|
<form action='' method='POST'>
|
||||||
{% csrf_token %}
|
{% csrf_token %}
|
||||||
<input type='hidden' name='id' value='{{o.id}}'>
|
<input type='hidden' name='id' value='{{o.id}}'>
|
||||||
|
@ -64,8 +65,8 @@
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
</span>
|
</span>
|
||||||
<button type='button' onclick='toggle_visibility("op{{o.id}}");' title='Skrýt/Zobrazit'>
|
<button type='button' onclick='toggle_visibility(this.parentElement.parentElement.parentElement);' title='Skrýt/Zobrazit'>
|
||||||
<img id='op{{o.id}}-toggleimg' src="{% static "korektury/imgs/hide.png" %}"/>
|
<img id='op{{o.id}}-toggleimg' class='toggle-button' src="{% static "korektury/imgs/hide.png" %}"/>
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
</span>
|
</span>
|
||||||
|
|
Loading…
Reference in a new issue