feat: updates option count for each episode when filter changes
This commit is contained in:
@@ -14,16 +14,18 @@ export default class extends Controller {
|
||||
active: Boolean,
|
||||
};
|
||||
|
||||
static targets = ['list']
|
||||
|
||||
static targets = ['list', 'count']
|
||||
static outlets = ['loading-icon']
|
||||
|
||||
options = []
|
||||
|
||||
connect() {
|
||||
if (true === this.activeValue) {
|
||||
fetch(`/torrentio/tvshows/${this.tmdbIdValue}/${this.imdbIdValue}/${this.seasonValue}/${this.episodeValue}`)
|
||||
.then(res => res.text())
|
||||
.then(response => {
|
||||
this.element.innerHTML = response;
|
||||
this.options = this.element.querySelectorAll('tbody tr');
|
||||
this.loadingIconOutlet.increaseCount();
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user