mirror of
https://github.com/MrUnknownDE/VRCX.git
synced 2026-05-07 06:56:04 +02:00
Add select all / deselect all button to favorites (#1501)
This commit is contained in:
@@ -298,6 +298,13 @@
|
||||
</div>
|
||||
<div class="favorites-content__edit-actions">
|
||||
<div v-if="worldEditMode && !isSearchActive" class="favorites-content__actions">
|
||||
<el-button size="small" @click="toggleSelectAllWorlds">
|
||||
{{
|
||||
isAllWorldsSelected
|
||||
? t('view.favorite.deselect_all')
|
||||
: t('view.favorite.select_all')
|
||||
}}
|
||||
</el-button>
|
||||
<el-button size="small" :disabled="!hasWorldSelection" @click="clearSelectedWorlds">
|
||||
{{ t('view.favorite.clear') }}
|
||||
</el-button>
|
||||
@@ -638,6 +645,15 @@
|
||||
}
|
||||
});
|
||||
|
||||
const isAllWorldsSelected = computed(() => {
|
||||
if (!activeRemoteGroup.value || !currentRemoteFavorites.value.length) {
|
||||
return false;
|
||||
}
|
||||
return currentRemoteFavorites.value
|
||||
.map((fav) => fav.id)
|
||||
.every((id) => selectedFavoriteWorlds.value.includes(id));
|
||||
});
|
||||
|
||||
watch(
|
||||
() => ({
|
||||
remote: favoriteWorldGroups.value.map((group) => group.key),
|
||||
@@ -855,6 +871,17 @@
|
||||
selectedFavoriteWorlds.value = [];
|
||||
}
|
||||
|
||||
function toggleSelectAllWorlds() {
|
||||
if (!activeRemoteGroup.value) {
|
||||
return;
|
||||
}
|
||||
if (isAllWorldsSelected.value) {
|
||||
selectedFavoriteWorlds.value = [];
|
||||
} else {
|
||||
selectedFavoriteWorlds.value = currentRemoteFavorites.value.map((fav) => fav.id);
|
||||
}
|
||||
}
|
||||
|
||||
function copySelectedWorlds() {
|
||||
if (!selectedFavoriteWorlds.value.length) {
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user