change display of media when has_camera

pull/37/head
Niko PLP 2 months ago
parent 68ad4ac632
commit 947afbdceb
  1. 13
      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,14 +999,13 @@
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>
{/if}
<div style="padding:0;" bind:this={createMenu.media}></div>
<MenuItem title={$t("doc.media")} clickable={ () => { createMenuOpened.media = !createMenuOpened.media; scrollToCreateMenu("media"); } }>
@ -1023,7 +1022,15 @@
<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