From 2388a083128d812fd9329ed5fed157963d18af54 Mon Sep 17 00:00:00 2001 From: Rahul Gurung Date: Mon, 5 Oct 2020 22:27:08 +0530 Subject: [PATCH] fixed the modal popup issue and minor changes --- README.md | 4 +--- src/features/expand-description.js | 8 ++++++-- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index a8812f9..0d56bd5 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@ Coming Soon ## Highlights GENERAL - Keep the sidebar collapsed by default ([@gurrrung](https://github.com/gurrrung)) -- Hide boosted videos in search results ([@iamsahil1910](https://github.com/iamsahil1910)) +- Hide boosted videos in search results ([@gurrrung](https://github.com/gurrrung)) VIDEO - Make sure that the AutoPlay is disabled by default always ([@gurrrung](https://github.com/gurrrung)) @@ -54,6 +54,4 @@ Both commands will create a `dist/` directory, it will contain the built files t ## Contributing -### Note: We can accept outside contributors only after 5 Oct as this project is being submitted to a hackathon. - Contributions are welcome, feel free to create an issue with your feature idea or just resolve any available issues. The guide for creating a new feature is available [here](https://github.com/gurrrung/YourTube/blob/master/CONTRIBUTING.md). diff --git a/src/features/expand-description.js b/src/features/expand-description.js index 240e203..e5b4bab 100644 --- a/src/features/expand-description.js +++ b/src/features/expand-description.js @@ -3,6 +3,10 @@ import elementReady from 'element-ready'; export default async function () { await elementReady('yt-formatted-string.more-button.style-scope.ytd-video-secondary-info-renderer'); await elementReady('paper-button#less.style-scope.ytd-expander'); - $('yt-formatted-string.more-button.style-scope.ytd-video-secondary-info-renderer').trigger('click'); - $('paper-button#less.style-scope.ytd-expander').hide(); + let isCollapsed = $('ytd-expander.style-scope.ytd-video-secondary-info-renderer').attr('collapsed'); + + if (typeof isCollapsed !== typeof undefined && isCollapsed !== false) { + $('yt-formatted-string.more-button.style-scope.ytd-video-secondary-info-renderer').trigger('click'); + $('paper-button#less.style-scope.ytd-expander').hide(); + } }