Browse Source

fix(gui-v2): show preview as only if it is not-null

Signed-off-by: Pranav C <pranavxc@gmail.com>
pull/3091/head
Pranav C 2 years ago
parent
commit
f0a345a807
  1. 9
      packages/nc-gui-v2/components/general/PreviewAs.vue
  2. 1
      packages/nc-gui-v2/pages/nc/[projectId]/index.vue

9
packages/nc-gui-v2/components/PreviewAs.vue → packages/nc-gui-v2/components/general/PreviewAs.vue

@ -48,7 +48,12 @@ watch(previewAs, () => window.location.reload())
</script> </script>
<template> <template>
<div v-if="float" class="floating-reset-btn nc-floating-preview-btn px-2" :style="{ top: position.y, left: position.x }"> <div
v-if="float"
v-show="previewAs"
class="floating-reset-btn nc-floating-preview-btn px-2"
:style="{ top: position.y, left: position.x }"
>
<MdiDrag style="cursor: move" class="text-white" @mousedown="mouseDown" /> <MdiDrag style="cursor: move" class="text-white" @mousedown="mouseDown" />
<div class="divider" /> <div class="divider" />
@ -95,7 +100,7 @@ watch(previewAs, () => window.location.reload())
<style scoped> <style scoped>
.floating-reset-btn { .floating-reset-btn {
@apply bg-primary/80 z-1000 index-100 fixed text-white py-1 pr-3 text-xs font-weight-bold @apply bg-primary/90 z-1000 index-100 fixed text-white py-1 pr-3 text-xs font-weight-bold
@apply flex items-center overflow-hidden whitespace-nowrap gap-2 rounded shadow-md; @apply flex items-center overflow-hidden whitespace-nowrap gap-2 rounded shadow-md;
} }

1
packages/nc-gui-v2/pages/nc/[projectId]/index.vue

@ -1,5 +1,6 @@
<script setup lang="ts"> <script setup lang="ts">
import { navigateTo, provideSidebar, ref, useProject, useRoute, useSidebar, useTabs, useUIPermission } from '#imports' import { navigateTo, provideSidebar, ref, useProject, useRoute, useSidebar, useTabs, useUIPermission } from '#imports'
import PreviewAs from '~/components/general/PreviewAs.vue'
import { TabType } from '~/composables' import { TabType } from '~/composables'
import { openLink } from '~/utils' import { openLink } from '~/utils'

Loading…
Cancel
Save