1
0
Fork 0
mirror of https://git.sr.ht/~cadence/cloudtube synced 2026-05-26 12:32:25 +00:00

Highlight current chapter in video description

This commit is contained in:
Cadence Ember 2021-07-02 00:41:50 +12:00
parent eb111a44c4
commit f62fce4fea
No known key found for this signature in database
GPG key ID: BC1C2C61CF521B17
8 changed files with 86 additions and 4 deletions

View file

@ -1,24 +0,0 @@
import {ElemJS} from "/static/js/elemjs/elemjs.js"
class MarkWatchedButton extends ElemJS {
constructor(element) {
super(element)
this.on("click", this.onClick.bind(this))
}
onClick(event) {
event.preventDefault()
let video = this.element
while (!video.classList.contains("subscriptions-video")) {
video = video.parentElement
}
video.classList.add("video-list-item--watched")
const form = this.element.parentElement
fetch(form.getAttribute("action"), {method: "POST"})
form.remove()
}
}
export {
MarkWatchedButton
}