Skip to content

armgit / my-yt

Public Imported from GitHub
0

A clean and minimal youtube frontend, without all the ads and whistles

JavaScript

revert: download only by clicking download button, not video img

Christian Fei7f462b3a8435
diff --git a/client/components/video-element.js b/client/components/video-element.js
index a551f82..af2e97f 100644
--- a/client/components/video-element.js
+++ b/client/components/video-element.js
@@ -39,7 +39,7 @@ class VideoElement extends HTMLElement {
this.innerHTML = /*html*/`
${this.video.downloaded
? /*html*/`<div class="play video-placeholder" style="background-image: url(${this.video.thumbnail})"><div class="play-icon"></div></div>`
- : /*html*/`<img title="Download video" class="download" loading="lazy" src="${this.video.thumbnail}"/>`}
+ : /*html*/`<img title="Download video" class="download!" loading="lazy" src="${this.video.thumbnail}"/>`}
<span class="action ignore" tabindex="0">${this.video.ignored ? 'unignore' : 'ignore'}</span>
<div class="info">
<span class="channel-name">${this.video.channelName}</span>
@@ -68,7 +68,7 @@ class VideoElement extends HTMLElement {
}
registerEvents () {
addClickListener(this.querySelector('.action.download'), this.downloadVideoHandler.bind(this))
- addClickListener(this.querySelector('img.download'), this.downloadVideoHandler.bind(this))
+ // addClickListener(this.querySelector('img.download'), this.downloadVideoHandler.bind(this))
addClickListener(this.querySelector('.action.delete'), this.deleteVideoHandler.bind(this))
addClickListener(this.querySelector('.action.summarize'), this.summarizeVideoHandler.bind(this))
addClickListener(this.querySelector('.action.show-summary'), this.showSummaryHandler.bind(this))
@@ -78,7 +78,7 @@ class VideoElement extends HTMLElement {
}
unregisterEvents () {
removeClickListener(this.querySelector('.action.download'), this.downloadVideoHandler.bind(this))
- removeClickListener(this.querySelector('img.download'), this.downloadVideoHandler.bind(this))
+ // removeClickListener(this.querySelector('img.download'), this.downloadVideoHandler.bind(this))
removeClickListener(this.querySelector('.action.delete'), this.deleteVideoHandler.bind(this))
removeClickListener(this.querySelector('.action.summarize'), this.summarizeVideoHandler.bind(this))
removeClickListener(this.querySelector('.action.show-summary'), this.showSummaryHandler.bind(this))
diff --git a/client/main.css b/client/main.css
index 56733a3..e20d5e0 100644
--- a/client/main.css
+++ b/client/main.css
@@ -189,7 +189,9 @@ input[type="text"], input[type="url"], input[type="search"] {
.video img {
width: 100%;
height: auto;
- cursor: pointer;
+}
+.video img.download {
+ /* cursor: pointer; */
}
.hide-thumbnails .video img {
display: none !important;