Przeglądaj źródła

fix: 悬浮框定位;暗黑模式bug;双击翻页框不放大

wzl 2 miesięcy temu
rodzic
commit
fb1a310029

+ 2 - 1
packages/webview/src/components/DocumentContainer/DocumentContainer.vue

@@ -127,7 +127,8 @@ function onDoubleClick() {
 }
 
 function onSingleClick(e) {
-  if (e.target.nodeName === 'A') return
+  const pageNav = mainContainer.value.querySelector('.page-nav')
+  if (e.target.nodeName === 'A' || pageNav?.contains(e.target)) return
   const currentTime = new Date().getTime()
   if (currentTime - lastClickTime < 300) {
     onDoubleClick() // 如果在 300ms 内点击两次,视为双击

+ 1 - 0
packages/webview/src/components/Dropdown/Dropdown.vue

@@ -71,6 +71,7 @@
   })
 
   watch(themeMode, () => {
+    if (!isMobileDevice) return
     const $html = document.documentElement
     $html.classList.toggle('dark')
   })

+ 2 - 1
packages/webview/src/components/Popups/ContentEditorPopup.vue

@@ -1,6 +1,6 @@
 <template>
   <div ref="contentEditorPopupRef">
-    <div v-show="showPopup && contentEditorPopup.length" class="content-editor-popup popup" :style="{ top: `${top}px`, left: `${left}px` }">
+    <div v-show="showPopup && contentEditorPopup.length" class="content-editor-popup popup" :style="{ top: `${top}px`, left: `${left}px`, transform: `translateX(${!isMobileDevice && isOpen ? -130 : 0}px) translateY(5px)` }">
       <template v-for="(item, index) in contentEditorPopup" :key="`${item.dataElement || new Date()}-${index}`">
         <CustomButton v-if="item.name === 'customButton' && !item.hidden" :item="item" :data-element="item.dataElement" />
         <Button v-else-if="item.type === 'copy' && !item.hidden" @click="handlePopup('copy')" :title="$t('documentEditor.copy')" :data-element="item.dataElement"><CopyText /></Button>
@@ -18,6 +18,7 @@ import core from '@/core'
 
 import { useViewerStore } from '@/stores/modules/viewer'
 import { useDocumentStore } from '@/stores/modules/document'
+import { isMobileDevice } from '@/helpers/device'
 
 const useViewer = useViewerStore()
 const useDocument = useDocumentStore()

+ 1 - 0
packages/webview/src/components/Popups/TextPopup.vue

@@ -121,6 +121,7 @@ onUnmounted(() => {
   background: var(--c-header-bg);
   box-shadow: 0 0 3px 0 #868e96;
   transform: translateY(5px);
+  transition: transform 0.3s ease-in-out;
 
   &.transform {
     transform: translateX(-50%) translateY(5px);