mirror of
https://gitea.invidious.io/iv-org/invidious-copy-2023-06-08.git
synced 2024-08-15 00:53:38 +00:00
Allow for collapsing and expanding of Reddit comments
This commit is contained in:
parent
62dbd361de
commit
38d7dfd7e3
2 changed files with 13 additions and 6 deletions
|
@ -321,12 +321,12 @@ def template_comments(root)
|
|||
|
||||
content = <<-END_HTML
|
||||
<p>
|
||||
<a class="link" href="javascript:void(0)" onclick="dismiss(this.parentNode.parentNode)">[ - ]</a>
|
||||
#{score}
|
||||
<b>#{author}</b>
|
||||
<a class="link" href="javascript:void(0)" onclick="toggle(this)">[ - ]</a> #{score} <b>#{author}</b>
|
||||
</p>
|
||||
<p>#{body_html}</p>
|
||||
<div>
|
||||
#{body_html}
|
||||
#{replies_html}
|
||||
</div>
|
||||
END_HTML
|
||||
|
||||
if child["data"]["depth"].as_i > 0
|
||||
|
|
|
@ -61,8 +61,15 @@ var player = videojs('player', options, function() {
|
|||
});
|
||||
});
|
||||
|
||||
function dismiss(target) {
|
||||
target.style.display = 'none';
|
||||
function toggle(target) {
|
||||
body = target.parentNode.parentNode.children[1];
|
||||
if (body.style.display === null || body.style.display === '') {
|
||||
target.innerHTML = '[ + ]';
|
||||
body.style.display = 'none';
|
||||
} else {
|
||||
target.innerHTML = '[ - ]';
|
||||
body.style.display = '';
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
|
|
Loading…
Reference in a new issue