change display of media when has_camera

pull/37/head
Niko PLP 5 months ago
parent 68ad4ac632
commit 947afbdceb
  1. 55
      ng-app/src/lib/FullLayout.svelte
  2. 2
      ng-app/src/lib/components/PaneHeader.svelte

@ -981,7 +981,7 @@
{/if}
{#await check_has_camera() then has_camera}
{#if !has_camera}
{#if has_camera}
<MenuItem title={$t("buttons.scan_qr")} clickable={ ()=> scan_qr() }>
<QrCode tabindex="-1"
class="w-7 h-7 text-gray-700 focus:outline-none dark:text-white"/>
@ -999,31 +999,38 @@
class="w-7 h-7 text-gray-700 focus:outline-none dark:text-white"/>
<span class="ml-3">{$t("doc.record_reel")}</span>
</MenuItem>
{/if}
{/await}
<MenuItem title={$t("doc.record_voice")} clickable={ ()=> record_voice() }>
<Microphone tabindex="-1"
class="w-7 h-7 text-gray-700 focus:outline-none dark:text-white"/>
<span class="ml-3">{$t("doc.record_voice")}</span>
</MenuItem>
<div style="padding:0;" bind:this={createMenu.media}></div>
<MenuItem title={$t("doc.media")} clickable={ () => { createMenuOpened.media = !createMenuOpened.media; scrollToCreateMenu("media"); } }>
<DocumentArrowUp
tabindex="-1"
class="w-7 h-7 text-gray-700 focus:outline-none dark:text-white"
/>
<span class="ml-3">{$t("doc.media")}</span>
</MenuItem>
{#if createMenuOpened.media }
{#each create_media_items as item}
<MenuItem title={get_class(item)["ng:a"]} extraClass="submenu" clickable={ () => new_document(item) }>
<DataClassIcon dataClass={item} {config}/>
<span class="ml-3">{get_class(item)["ng:n"]}</span>
<MenuItem title={$t("doc.record_voice")} clickable={ ()=> record_voice() }>
<Microphone tabindex="-1"
class="w-7 h-7 text-gray-700 focus:outline-none dark:text-white"/>
<span class="ml-3">{$t("doc.record_voice")}</span>
</MenuItem>
{/each}
{/if}
{/if}
<div style="padding:0;" bind:this={createMenu.media}></div>
<MenuItem title={$t("doc.media")} clickable={ () => { createMenuOpened.media = !createMenuOpened.media; scrollToCreateMenu("media"); } }>
<DocumentArrowUp
tabindex="-1"
class="w-7 h-7 text-gray-700 focus:outline-none dark:text-white"
/>
<span class="ml-3">{$t("doc.media")}</span>
</MenuItem>
{#if createMenuOpened.media }
{#each create_media_items as item}
<MenuItem title={get_class(item)["ng:a"]} extraClass="submenu" clickable={ () => new_document(item) }>
<DataClassIcon dataClass={item} {config}/>
<span class="ml-3">{get_class(item)["ng:n"]}</span>
</MenuItem>
{/each}
{#if !has_camera}
<MenuItem title={$t("doc.record_voice")} extraClass="submenu" clickable={ ()=> record_voice() }>
<Microphone tabindex="-1"
class="w-7 h-7 text-gray-700 focus:outline-none dark:text-white"/>
<span class="ml-3">{$t("doc.record_voice")}</span>
</MenuItem>
{/if}
{/if}
{/await}
<div style="padding:0;" bind:this={createMenu.chart}></div>
<MenuItem title={$t("doc.chart")} clickable={ () => { createMenuOpened.chart = !createMenuOpened.chart; scrollToCreateMenu("chart"); } }>

@ -41,7 +41,7 @@
on:click={()=>closePane(pane_name)}
on:keypress={()=>closePane(pane_name)}
tabindex="0">
<XMark class="w-8 h-8 p-1 text-gray-300 focus:outline-none dark:text-white"/>
<XMark class="w-8 h-8 p-1 text-gray-400 focus:outline-none dark:text-white"/>
</div>
<div style="height:44px; background-color: rgb(251, 251, 251);" class="p-1 flex items-center">
<Icon tabindex="-1" class="w-8 h-8 text-gray-400 dark:text-white focus:outline-none " variation="outline" color="currentColor" icon={pane_items[pane_name]} />

Loading…
Cancel
Save