add option to hide post tags and header

This commit is contained in:
iou1name 2022-08-18 20:27:39 -04:00
parent 8ad34cc221
commit bcfe40292d
2 changed files with 22 additions and 0 deletions

View File

@ -68,6 +68,22 @@ function toggle_visibility(event) {
post.classList.remove(vis_class[event.target.parentElement.cellIndex - 1]); post.classList.remove(vis_class[event.target.parentElement.cellIndex - 1]);
} }
} }
} else if (tag == 'post tags') {
for (let post of document.querySelectorAll('.post_container > .tags')) {
if (event.target.checked) {
post.classList.add(vis_class[event.target.parentElement.cellIndex - 1]);
} else {
post.classList.remove(vis_class[event.target.parentElement.cellIndex - 1]);
}
}
} else if (tag == 'post header') {
for (let post of document.querySelectorAll('.post_container > .header')) {
if (event.target.checked) {
post.classList.add(vis_class[event.target.parentElement.cellIndex - 1]);
} else {
post.classList.remove(vis_class[event.target.parentElement.cellIndex - 1]);
}
}
} else { } else {
for (let post of document.querySelectorAll('.' + tag)) { for (let post of document.querySelectorAll('.' + tag)) {
if (event.target.checked) { if (event.target.checked) {

View File

@ -30,6 +30,12 @@
<td>{{ tag }}</td><td><input type="checkbox" onchange="toggle_visibility(event)"></td><td><input type="checkbox" onchange="toggle_visibility(event)"></td> <td>{{ tag }}</td><td><input type="checkbox" onchange="toggle_visibility(event)"></td><td><input type="checkbox" onchange="toggle_visibility(event)"></td>
</tr> </tr>
{% endfor %} {% endfor %}
<tr>
<td>post tags</td><td></td><td><input type="checkbox" onchange="toggle_visibility(event)"></td>
</tr>
<tr>
<td>post header</td><td></td><td><input type="checkbox" onchange="toggle_visibility(event)"></td>
</tr>
</tbody> </tbody>
</table> </table>
</div> </div>