offset for viewer menu if no discrete

master
Niko PLP 3 months ago
parent 2f799ed937
commit 3926f1f2e4
  1. 2
      ng-app/src/lib/FullLayout.svelte
  2. 8
      ng-app/src/lib/components/MenuItem.svelte

@ -645,7 +645,7 @@
</li> </li>
{/if} {/if}
{#if $cur_viewer} {#if $cur_viewer}
<MenuItem selected={$cur_tab_view_or_edit} title={$cur_viewer["ng:a"]} dropdown={$available_viewers.length > 1 ? open_view_as : undefined} clickable={($available_viewers.length > 1 || !$cur_tab_view_or_edit) && function () { if ($available_viewers.length > 1) { open_view_as = !open_view_as; } else { set_view_or_edit(true); hideMenu(); } open_edit_with=false;} }> <MenuItem offset={!$cur_tab_branch_has_discrete} selected={$cur_tab_view_or_edit} title={$cur_viewer["ng:a"]} dropdown={$available_viewers.length > 1 ? open_view_as : undefined} clickable={($available_viewers.length > 1 || !$cur_tab_view_or_edit) && function () { if ($available_viewers.length > 1) { open_view_as = !open_view_as; } else { set_view_or_edit(true); hideMenu(); } open_edit_with=false;} }>
<Eye <Eye
tabindex="-1" tabindex="-1"
class="w-7 h-7 text-gray-700 focus:outline-none dark:text-white " class="w-7 h-7 text-gray-700 focus:outline-none dark:text-white "

@ -17,6 +17,7 @@
export let selected = false; export let selected = false;
export let title = ""; export let title = "";
export let dropdown = undefined; export let dropdown = undefined;
export let offset = false;
import { import {
ChevronUp, ChevronUp,
@ -31,12 +32,17 @@
on:click={(e) => { e.currentTarget.blur(); clickable();}} on:keypress={clickable} on:keydown={(e) => {if (e.code=='Space') { e.preventDefault(); clickable();} }}> on:click={(e) => { e.currentTarget.blur(); clickable();}} on:keypress={clickable} on:keydown={(e) => {if (e.code=='Space') { e.preventDefault(); clickable();} }}>
<slot /> <slot />
{#if dropdown!==undefined} {#if dropdown!==undefined}
<div class="grow"></div> <div class="grow"></div>
{#if dropdown} {#if dropdown}
<ChevronUp/> <ChevronUp/>
{:else} {:else}
<ChevronDown/> <ChevronDown/>
{/if} {/if}
{#if offset}
<div style="width:35px;">
</div>
{/if}
{/if} {/if}
</li> </li>
{:else if clickable === false} {:else if clickable === false}

Loading…
Cancel
Save