Skip to content

Commit

Permalink
Fix checkbox issues
Browse files Browse the repository at this point in the history
It wasn't possible to check the checkbox by clicking on it, due to
incorrect Alpine.js usage.
  • Loading branch information
JanOppolzer committed Feb 19, 2024
1 parent 3585571 commit 3f136ca
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 10 deletions.
3 changes: 2 additions & 1 deletion resources/views/categories/import.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ class="dark:bg-gray-700 px-6 py-3 text-xs tracking-widest text-left uppercase bg
<tr x-data class="hover:bg-blue-50 dark:hover:bg-gray-700"
@click="checkbox = $el.querySelector('input[type=checkbox]'); checkbox.checked = !checkbox.checked">
<td class="px-6 py-3 text-sm">
<input class="rounded" type="checkbox" name="categories[]" value="{{ $category }}">
<input @click.stop class="rounded" type="checkbox" name="categories[]"
value="{{ $category }}">
</td>
<td class="px-6 py-3 text-sm">
<code class="text-sm text-pink-500">
Expand Down
2 changes: 1 addition & 1 deletion resources/views/entities/federations.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
<tr x-data class="bg-white" role="button"
@click="checkbox = $el.querySelector('input[type=checkbox]'); checkbox.checked = !checkbox.checked">
<td class="px-6 py-3 text-sm">
<input class="rounded" type="checkbox" name="federations[]"
<input @click.stop class="rounded" type="checkbox" name="federations[]"
value="{{ $federation->id }}">
</td>
<td class="px-6 py-3 text-sm">
Expand Down
6 changes: 4 additions & 2 deletions resources/views/entities/operators.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ class="dark:bg-gray-700 px-6 py-3 text-xs tracking-widest text-left uppercase bg
<tr x-data class="bg-white" role="button"
@click="checkbox = $el.querySelector('input[type=checkbox]'); checkbox.checked = !checkbox.checked">
<td class="px-6 py-3 text-sm">
<input class="rounded" type="checkbox" name="operators[]" value="{{ $operator->id }}">
<input @click.stop class="rounded" type="checkbox" name="operators[]"
value="{{ $operator->id }}">
</td>
<td class="whitespace-nowrap px-6 py-3 text-sm">
{{ $operator->name }}
Expand Down Expand Up @@ -108,7 +109,8 @@ class="dark:bg-gray-700 px-6 py-3 text-xs tracking-widest text-left uppercase bg
<tr x-data class="bg-white" role="button"
@click="checkbox = $el.querySelector('input[type=checkbox]'); checkbox.checked = !checkbox.checked">
<td class="px-6 py-3 text-sm">
<input class="rounded" type="checkbox" name="operators[]" value="{{ $user->id }}">
<input @click.stop class="rounded" type="checkbox" name="operators[]"
value="{{ $user->id }}">
</td>
<td class="whitespace-nowrap px-6 py-3 text-sm">
{{ $user->name }}
Expand Down
6 changes: 4 additions & 2 deletions resources/views/federations/entities.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@
<tr x-data class="hover:bg-blue-50" role="button"
@click="checkbox = $el.querySelector('input[type=checkbox]'); checkbox.checked = !checkbox.checked">
<td class="px-6 py-3 text-sm">
<input class="rounded" type="checkbox" name="entities[]" value="{{ $entity->id }}">
<input @click.stop class="rounded" type="checkbox" name="entities[]"
value="{{ $entity->id }}">
</td>
<td class="whitespace-nowrap px-6 py-3 text-sm">
{{ $entity->{"name_$locale"} }}
Expand Down Expand Up @@ -109,7 +110,8 @@
<tr x-data class="hover:bg-blue-50" role="button"
@click="checkbox = $el.querySelector('input[type=checkbox]'); checkbox.checked = !checkbox.checked">
<td class="px-6 py-3 text-sm">
<input class="rounded" type="checkbox" name="entities[]" value="{{ $entity->id }}">
<input @click.stop class="rounded" type="checkbox" name="entities[]"
value="{{ $entity->id }}">
</td>
<td class="whitespace-nowrap px-6 py-3 text-sm">
{{ $entity->{"name_$locale"} }}
Expand Down
2 changes: 1 addition & 1 deletion resources/views/federations/import.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class="dark:bg-gray-700 px-6 py-3 text-xs tracking-widest text-left uppercase bg
<tr x-data class="hover:bg-blue-50 dark:hover:bg-gray-700" role="button"
@click="checkbox = $el.querySelector('input[type=checkbox]'); checkbox.checked = !checkbox.checked">
<td class="px-6 py-3 text-sm">
<input class="rounded" type="checkbox" name="federations[]"
<input @click.stop class="rounded" type="checkbox" name="federations[]"
value="{{ $federation['cfgfile'] }}">
</td>
<td class="px-6 py-3 text-sm">
Expand Down
6 changes: 4 additions & 2 deletions resources/views/federations/operators.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@ class="dark:bg-gray-700 px-6 py-3 text-xs tracking-widest text-left uppercase bg
<tr x-data class="bg-white" role="button"
@click="checkbox = $el.querySelector('input[type=checkbox]'); checkbox.checked = !checkbox.checked">
<td class="px-6 py-3 text-sm">
<input class="rounded" type="checkbox" name="operators[]" value="{{ $operator->id }}">
<input @click.stop class="rounded" type="checkbox" name="operators[]"
value="{{ $operator->id }}">
</td>
<td class="whitespace-nowrap px-6 py-3 text-sm">
{{ $operator->name }}
Expand Down Expand Up @@ -108,7 +109,8 @@ class="dark:bg-gray-700 px-6 py-3 text-xs tracking-widest text-left uppercase bg
<tr x-data class="bg-white" role="button"
@click="checkbox = $el.querySelector('input[type=checkbox]'); checkbox.checked = !checkbox.checked">
<td class="px-6 py-3 text-sm">
<input class="rounded" type="checkbox" name="operators[]" value="{{ $user->id }}">
<input @click.stop class="rounded" type="checkbox" name="operators[]"
value="{{ $user->id }}">
</td>
<td class="whitespace-nowrap px-6 py-3 text-sm">
{{ $user->name }}
Expand Down
3 changes: 2 additions & 1 deletion resources/views/groups/import.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ class="dark:bg-gray-700 px-6 py-3 text-xs tracking-widest text-left uppercase bg
<tr x-data class="hover:bg-blue-50 dark:hover:bg-gray-700"
@click="checkbox = $el.querySelector('input[type=checkbox]'); checkbox.checked = !checkbox.checked">
<td class="px-6 py-3 text-sm">
<input class="rounded" type="checkbox" name="groups[]" value="{{ $group }}">
<input @click.stop class="rounded" type="checkbox" name="groups[]"
value="{{ $group }}">
</td>
<td class="px-6 py-3 text-sm">
<code class="text-sm text-pink-500">
Expand Down

0 comments on commit 3f136ca

Please sign in to comment.