Browse Source

fix: 回归测试修复

wzl 4 months ago
parent
commit
b114830145

+ 2 - 2
packages/core/src/markup/text_annotation.js

@@ -123,7 +123,7 @@ class TextAnnotation extends BaseAnnotation {
     deletetButton.addEventListener('click', this.onDelete)
     deletetButton.innerHTML = this.deleteSvgStr
     deletetButton.style.left = (rect.left + rect.width - 30) + 'px'
-    deletetButton.style.top = (rect.top - 38) + 'px'
+    deletetButton.style.top = (rect.top + rect.height + 8) + 'px'
 
     this.replyButton = createElement(
       'div',
@@ -143,7 +143,7 @@ class TextAnnotation extends BaseAnnotation {
     this.replyButton.addEventListener('click', this.onOpenReply)
     this.replyButton.innerHTML = this.replySvgStr
     this.replyButton.style.left = (rect.left + rect.width - 65) + 'px'
-    this.replyButton.style.top = (rect.top - 38) + 'px'
+    this.replyButton.style.top = (rect.top + rect.height + 8) + 'px'
 
     this.deletetButton = deletetButton
     this.outerLineContainer.append(rectContainer)

+ 2 - 1
packages/core/src/pdf_thumbnail_view.js

@@ -1,5 +1,5 @@
 import { RenderingCancelledException } from "pdfjs-dist/legacy/build/pdf";
-import { OutputScale, RenderingStates } from "./ui_utils.js";
+import { OutputScale, RenderingStates, isMobile } from "./ui_utils.js";
 
 const DRAW_UPSCALE_FACTOR = 2; // See comment in `PDFThumbnailView.draw` below.
 const MAX_NUM_SCALING_STEPS = 3;
@@ -79,6 +79,7 @@ class PDFThumbnailView {
     const anchor = document.createElement("div");
     anchor.onclick = function () {
       linkService.goToPage(id)
+      isMobile && window.instances.UI.closeElement('leftPanel')
       return false
     }
     this.anchor = anchor;

+ 3 - 2
packages/webview/src/components/AnnotationContainer/AnnotationContent.vue

@@ -370,7 +370,7 @@ const onOutsidePopover = (e) => {
   }
 }
 
-const selectReturn = (item) => {
+const selectReturn = (item, flag) => {
   showReplyInput.value = true
 
   if (selectedAnnot.value?.name !== item.name) {
@@ -378,6 +378,7 @@ const selectReturn = (item) => {
     replyText.value = ''
   }
 
+  if (flag) return
   nextTick(() => {
     document.querySelector('.annotReplyInput')?.focus()
   })
@@ -391,7 +392,7 @@ const openAnnotationReply = (annotation) => {
     useViewer.openElement('leftPanel')
   }
 
-  selectReturn(annotation)
+  selectReturn(annotation, true)
 
   if (timeout) {
     clearTimeout(timeout)

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

@@ -491,6 +491,7 @@ const dragging = (e) => {
 
 // 拖拽结束
 const dragEnd = () => {
+  clearInterval(timer)
   dragContainer.value.removeEventListener(isMobileDevice ? 'touchmove' : 'mousemove', dragging)
   if (dragToIndex.value > -2 && !dragIndicateDisable(dragToIndex.value)) {
     handleMovePage(dragToIndex.value + 1)