This commit is contained in:
Tobias Wohlleben 2025-03-12 15:14:37 +01:00
parent f9c6ea0726
commit dce2713f4b
2 changed files with 3 additions and 13 deletions

View File

@ -4,7 +4,7 @@
<!-- Basic Page Needs -->
<meta charset="utf-8">
<title>Your page title here :)</title>
<title>Steam Workshop Viewer</title>
<meta name="description" content="">
<meta name="author" content="">
@ -55,7 +55,7 @@
<template x-for="item in items" :key="item.id">
<tr>
<td>
<input type="checkbox" x-on:click="checkItem" x-model="checkedItems" x-bind:value="item" class="checkbox"/>
<input type="checkbox" x-model="checkedItems" x-bind:value="item.id" class="checkbox" />
</td>
<td x-text="item.id"></td>
<td x-text="item.title"></td>

View File

@ -16,22 +16,12 @@ document.addEventListener('alpine:init', () => {
items: [],
loading: false,
checkedItems: [],
checkItem(e) {
let checkedItem = e.target.value;
console.log('checkedItem', checkedItem);
let checkbox = document.querySelectorAll('.checkbox').find(cb => cb.value === checkedItem.id);
checkbox.checked = e.target.checked;
console.log(this.checkedItems);
},
checkItems(e) {
if (e.target.checked) {
this.checkedItems = this.items;
this.checkedItems = this.items.map(item => item.id);
} else {
this.checkedItems = [];
}
console.log(this.checkedItems);
},
async getModDescription() {