From c35896094d1e46364f42948d27b97c938b453c36 Mon Sep 17 00:00:00 2001
From: sh4dowb
Date: Sun, 10 Nov 2019 20:47:37 +0300
Subject: [PATCH] Added "Read more" button to video description
---
assets/js/watch.js | 5 +++++
src/invidious/views/watch.ecr | 13 ++++++++++++-
2 files changed, 17 insertions(+), 1 deletion(-)
diff --git a/assets/js/watch.js b/assets/js/watch.js
index a26cb505..107050e1 100644
--- a/assets/js/watch.js
+++ b/assets/js/watch.js
@@ -356,6 +356,11 @@ function get_youtube_comments(retries) {
xhr.send();
}
+function read_more_description(srcButton) {
+ document.getElementById('descriptionWrapper').style.height = "unset";
+ srcButton.style.display = "none";
+}
+
function get_youtube_replies(target, load_more) {
var continuation = target.getAttribute('data-continuation');
diff --git a/src/invidious/views/watch.ecr b/src/invidious/views/watch.ecr
index 00a493af..d31416cd 100644
--- a/src/invidious/views/watch.ecr
+++ b/src/invidious/views/watch.ecr
@@ -187,7 +187,18 @@ var video_data = {
- <%= video.description_html %>
+ <% if video.description.size < 200 %>
+ <%= video.description_html %>
+ <% else %>
+
+ <%= video.description_html %>
+
+
+ <% end %>