wip-feat: pre-selects option for each episode

This commit is contained in:
2025-04-25 22:01:13 -05:00
parent cd271b568b
commit 9d350a572d
2 changed files with 6 additions and 2 deletions

View File

@@ -32,7 +32,10 @@ export default class extends Controller {
.then(response => {
this.element.innerHTML = response;
this.options = this.element.querySelectorAll('tbody tr');
this.options.forEach((option) => option.querySelector('.download-btn').dataset['title'] = this.titleValue);
if (this.options.length > 0) {
this.options.forEach((option) => option.querySelector('.download-btn').dataset['title'] = this.titleValue);
this.options[0].querySelector('input[type="checkbox"]').checked = true;
}
this.optionsLoaded = true;
this.loadingIconOutlet.increaseCount();
});