diff --git a/src/components/logic/DetailControls.svelte b/src/components/logic/DetailControls.svelte index 7f824f2..d9e8ad1 100644 --- a/src/components/logic/DetailControls.svelte +++ b/src/components/logic/DetailControls.svelte @@ -37,29 +37,49 @@ } return false; } + + function calculate(ids) { + let ret = []; + + if(ids.length > 1) { + ret.push("back"); + } + + if(hasRelations()) { + ret.push("hierarchy"); + } + + return ret + } + + $: displayedButtons = calculate($systemidStore); + + console.log(displayedButtons); - - {#if $systemidStore.length > 1} - - - {l10n.returntext[$appLanguageStore]}{$systemidStore.at(-2)} - - {/if} - {#if hasRelations()} - + + {l10n.returntext[$appLanguageStore]}{$systemidStore.at(-2)} + + {/if} + {#if displayedButtons.includes("hierarchy")} + + + {l10n.hierarchytext[$appLanguageStore]} + + {/if} + - - {l10n.hierarchytext[$appLanguageStore]} + + {l10n.assettext[$appLanguageStore]} - {/if} - - - {l10n.assettext[$appLanguageStore]} - - \ No newline at end of file + +{/if}