diff options
| author | Omar Roth <omarroth@hotmail.com> | 2018-03-12 18:36:08 -0500 |
|---|---|---|
| committer | Omar Roth <omarroth@hotmail.com> | 2018-03-12 18:36:08 -0500 |
| commit | 2bae09e018228139f6bb2a071d5fa9a9d4a060f1 (patch) | |
| tree | 2345ca1c085972f13fee567afc2977e4bd357183 | |
| parent | d7168815aa97320867b0f1486b3d1b3b4c043602 (diff) | |
| download | invidious-2bae09e018228139f6bb2a071d5fa9a9d4a060f1.tar.gz invidious-2bae09e018228139f6bb2a071d5fa9a9d4a060f1.tar.bz2 invidious-2bae09e018228139f6bb2a071d5fa9a9d4a060f1.zip | |
Add option to hide all reddit comments
| -rw-r--r-- | src/views/watch.ecr | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/src/views/watch.ecr b/src/views/watch.ecr index e70e4029..461627be 100644 --- a/src/views/watch.ecr +++ b/src/views/watch.ecr @@ -71,7 +71,18 @@ function toggle(target) { target.innerHTML = '[ - ]'; body.style.display = ''; } +}; + +function toggle_comments(target) { + body = target.parentNode.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> <div class="l-box"> @@ -116,13 +127,20 @@ function toggle(target) { </div> <hr style="margin-left:1em; margin-right:1em;"> <% if reddit_thread && !reddit_html.empty? %> + <div> <div style="overflow-wrap:break-word; word-wrap:break-word;"> - <h3><%= reddit_thread.data.title %></h3> + <h3> + <a href="javascript:void(0)" onclick="toggle_comments(this)">[ - ]</a> + <%= reddit_thread.data.title %> + </h3> <b> <a target="_blank" href="https://reddit.com<%= reddit_thread.data.permalink %>">View more comments on Reddit</a> </b> + </div> + <div> <%= reddit_html %> </div> + </div> <% end %> </div> </div> |
