feat: uses web components to simplify javascript logic
This commit is contained in:
@@ -40,15 +40,9 @@ export default class DownloadOptionTr extends HTMLTableRowElement {
|
||||
this.episodeId = this.getAttribute('episode-id') ?? null;
|
||||
this.#downloadBtnEl = this.querySelector('.download-btn');
|
||||
this.#selectEpisodeInputEl = this.querySelector('input[type="checkbox"]');
|
||||
console.log(this.#selectEpisodeInputEl)
|
||||
|
||||
this.#downloadBtnEl.addEventListener('click', () => this.download());
|
||||
// document.addEventListener('filterDownloadOptions', this.filter.bind(this));
|
||||
}
|
||||
connectedCallback() {
|
||||
|
||||
}
|
||||
|
||||
get isSelected() {
|
||||
return this.#selectEpisodeInputEl.checked;
|
||||
}
|
||||
@@ -57,16 +51,6 @@ export default class DownloadOptionTr extends HTMLTableRowElement {
|
||||
this.#selectEpisodeInputEl.checked = value;
|
||||
}
|
||||
|
||||
// attribute change
|
||||
attributeChangedCallback(property, oldValue, newValue) {
|
||||
if (oldValue === newValue) return;
|
||||
this[ property ] = newValue;
|
||||
}
|
||||
|
||||
static get observedAttributes() {
|
||||
return ['size', 'quality', 'resolution', 'codec', 'seeders', 'provider'];
|
||||
}
|
||||
|
||||
filter({ detail: { activeFilter } }) {
|
||||
const optionHeader = document.querySelector(`[data-option-id="${this.dataset['localId']}"]`)
|
||||
const props = {
|
||||
@@ -117,7 +101,6 @@ export default class DownloadOptionTr extends HTMLTableRowElement {
|
||||
}
|
||||
|
||||
download() {
|
||||
console.log('Downloading dis bihh')
|
||||
fetch('/api/download', {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
|
||||
Reference in New Issue
Block a user