mirror of
https://github.com/rommapp/romm.git
synced 2026-06-28 06:46:00 +00:00
Make setup platform rows toggle checkbox selection on click
Agent-Logs-Url: https://github.com/rommapp/romm/sessions/00a7f2a2-cabf-470b-a73e-a127ffcdccd5 Co-authored-by: gantoine <3247106+gantoine@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
6749728e6d
commit
2bb86e4836
@@ -28,6 +28,17 @@ const countSelectedInGroup = (platforms: Platform[]) => {
|
||||
selectedPlatformsModel.value.includes(p.fs_slug),
|
||||
).length;
|
||||
};
|
||||
|
||||
const togglePlatformSelection = (platformSlug: string) => {
|
||||
if (!props.showCheckboxes) return;
|
||||
|
||||
const selected = selectedPlatformsModel.value;
|
||||
const isSelected = selected.includes(platformSlug);
|
||||
|
||||
selectedPlatformsModel.value = isSelected
|
||||
? selected.filter((slug) => slug !== platformSlug)
|
||||
: [...selected, platformSlug];
|
||||
};
|
||||
</script>
|
||||
|
||||
<template>
|
||||
@@ -78,6 +89,7 @@ const countSelectedInGroup = (platforms: Platform[]) => {
|
||||
v-for="platform in platforms"
|
||||
:key="platform.fs_slug"
|
||||
:platform="platform"
|
||||
@click="togglePlatformSelection(platform.fs_slug)"
|
||||
>
|
||||
<template v-if="showCheckboxes" #prepend>
|
||||
<v-checkbox
|
||||
@@ -86,6 +98,7 @@ const countSelectedInGroup = (platforms: Platform[]) => {
|
||||
hide-details
|
||||
density="compact"
|
||||
class="mr-2"
|
||||
@click.stop
|
||||
/>
|
||||
</template>
|
||||
</PlatformListItem>
|
||||
|
||||
Reference in New Issue
Block a user