Commit 00d8d825 authored by Matthias Betz's avatar Matthias Betz
Browse files

fixed object library, moving category to tooltip, for more concise library

parent 2d19a90f
......@@ -516,15 +516,10 @@ export default function smartVillagesPlugin(config, baseUrl) {
objectUrl = model.url;
}
} else {
app.notifier.add({
type: NotificationType.ERROR,
message:
'Objekt mit dem namen: ' +
loadingObject.name +
' konnte nicht in den geladenen Objekten gefunden werden. Konfiguration konnte nicht vollständig geladen werden.',
});
// abort
return;
missingModels.push(loadingObject.name);
// go to next model
continue;
}
}
const cartPos = Cartesian3.fromDegrees(
......
......@@ -7,27 +7,31 @@
</template>
<template #default>
<v-expansion-panels multiple>
<VcsExpansionPanel v-for="(subcats, categoryName) in objLib" :key="categoryName" :heading="categoryName">
<v-container v-for="(entries, subCategory) in subcats" :key="subCategory" class=" py-1 px-1 border-b-md">
<v-col class="list-col">
<VcsLabel class="mb-4 text-h2">{{ subCategory }}</VcsLabel>
<v-list class="no-scroll">
<v-row>
<vcs-button v-for="entry in entries" :key="entry.title" @click="placeCatalogModel(entry.model)"
class="p-0 mx-1 my-0 border gc-2"
style="width: auto; height: auto; margin-left: 1rem; margin-bottom: 1px;" variant="filled">
<img :src="entry.icon" :alt="entry.icon"
style="display: block; max-width: 100%; max-height: 100%;" />
</vcs-button>
</v-row>
</v-list>
</v-col>
<v-divider />
<VcsExpansionPanel v-for = "(subcats, categoryName) in objLib" :key="categoryName" :heading="categoryName" >
<v-container class="px-1 py-0">
<v-row class="v-row--no-gutters">
<template v-for="(entries, subCategory) in subcats" :key = "subCategory">
<vcs-button
v-for="entry in entries"
:key="entry.title"
@click="placeCatalogModel(entry.model)"
class="p-0 mx-1 my-1 border gc-2"
style="width: 66px; height: 66px; margin-left: 1rem; margin-bottom: 1px;"
color="base-lighter-4"
variant="tonal"
:tooltip="getEntryTooltip(entry, subCategory)"
>
<img :src="entry.icon" :alt="entry.icon" style="display: block; width: 64px; height: 64px;" />
</vcs-button>
<v-divider/>
</template>
</v-row>
</v-container>
</VcsExpansionPanel>
</v-expansion-panels>
</template>
</VcsFormSection>
<VcsFormSection heading="Objektliste">
<template #help>
......@@ -212,6 +216,16 @@ async function retrieveCatalogJson(link) {
}
}
export function getEntryTooltip (entry, subcategory) {
let tooltip = '';
const category = subcategory || 'Unbekannt';
tooltip += category;
return tooltip;
}
function getCatalogEntries(json, linkPrefix) {
const part = {};
......@@ -578,6 +592,10 @@ export default {
saveConfiguration() {
saveObjects();
},
getEntryTooltip(entry, subcategory) {
return getEntryTooltip(entry, subcategory);
},
};
},
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment