Added "Read more" button to video description

This commit is contained in:
sh4dowb 2019-11-10 20:47:37 +03:00
parent 8af87f1a8b
commit c35896094d
No known key found for this signature in database
GPG Key ID: C063256324758B9D
2 changed files with 17 additions and 1 deletions

View File

@ -356,6 +356,11 @@ function get_youtube_comments(retries) {
xhr.send(); xhr.send();
} }
function read_more_description(srcButton) {
document.getElementById('descriptionWrapper').style.height = "unset";
srcButton.style.display = "none";
}
function get_youtube_replies(target, load_more) { function get_youtube_replies(target, load_more) {
var continuation = target.getAttribute('data-continuation'); var continuation = target.getAttribute('data-continuation');

View File

@ -187,7 +187,18 @@ var video_data = {
</p> </p>
<div> <div>
<% if video.description.size < 200 %>
<%= video.description_html %> <%= video.description_html %>
<% else %>
<div style="overflow: hidden;height: 8.3em;" id="descriptionWrapper">
<%= video.description_html %>
</div>
<div class="pure-u-23-24">
<p>
<a href="javascript:void(0)" onclick="read_more_description(this)"><%= translate(locale, "Read more") %></a>
</p>
</div>
<% end %>
</div> </div>
<hr> <hr>