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

@@ -148,7 +148,7 @@ export default class extends Controller {
} else if (true === firstIncluded) {
count = 1;
selectedCount = selectedCount + 1;
// option.selectInput.checked = true;
option.querySelector('input[type="checkbox"]').checked = true;
firstIncluded = false;
} else {
count = count + 1;
@@ -158,6 +158,7 @@ export default class extends Controller {
resultList.countTarget.innerText = count;
}
});
}
await results.forEach((list) => filterOperation(list, currentSeason));

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();
});