From d57bbe535a09c001f3bebc4d751541dad83202b5 Mon Sep 17 00:00:00 2001 From: "zhoulibin@xiaoxin" <125377187@qq.com> Date: Sun, 11 Aug 2024 09:52:29 +0800 Subject: [PATCH] =?UTF-8?q?overflowY:=20"overlay"=20=E6=94=B9=E8=BF=9B?= =?UTF-8?q?=E6=BB=9A=E5=8A=A8=E6=9D=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/action/action-searchWords2.ts | 3 +-- src/component/PopupRoot.tsx | 3 ++- src/modules/AnnotationsToNote.tsx | 5 +++-- src/modules/RelationHeader.tsx | 4 ++-- src/modules/highlightWords.tsx | 2 +- src/modules/menu.tsx | 2 +- src/utils/zzlb.ts | 2 +- 7 files changed, 11 insertions(+), 10 deletions(-) diff --git a/src/action/action-searchWords2.ts b/src/action/action-searchWords2.ts index 4b86e314..dd737101 100644 --- a/src/action/action-searchWords2.ts +++ b/src/action/action-searchWords2.ts @@ -3,8 +3,7 @@ const reader = Zotero.Reader.getByTabID(Zotero_Tabs.selectedID); - //@ts-ignore _iframeWindow - const PDFViewerApplication = reader._iframeWindow.wrappedJSObject.PDFViewerApplication; + const PDFViewerApplication = reader._iframeWindow?.wrappedJSObject.PDFViewerApplication; await PDFViewerApplication.pdfLoadingTask.promise; await PDFViewerApplication.pdfViewer.pagesPromise; const pages = PDFViewerApplication.pdfViewer._pages; diff --git a/src/component/PopupRoot.tsx b/src/component/PopupRoot.tsx index ce22e4ad..ef733bb3 100644 --- a/src/component/PopupRoot.tsx +++ b/src/component/PopupRoot.tsx @@ -1007,7 +1007,8 @@ export function PopupRoot({ style={{ maxWidth: (windowType == "FollowParent" && !params.ids ? selectionPopupSize.width - 16 : divMaxWidth) + "px", maxHeight: divMaxHeight + "px", - overflowY: "scroll", + //@ts-ignore overflowY + overflowY: "overlay", background: "#f00", }} > diff --git a/src/modules/AnnotationsToNote.tsx b/src/modules/AnnotationsToNote.tsx index 6f270ccc..13184d98 100644 --- a/src/modules/AnnotationsToNote.tsx +++ b/src/modules/AnnotationsToNote.tsx @@ -493,7 +493,7 @@ export function createSearchAnnContent(dialogWindow: Window | undefined, popupDi display: "flex", alignItems: "stretch", flexDirection: "column", - width: docWidth / columnSize - 20 - 20 / columnSize + "px", + width: docWidth / columnSize - 10 - 60 / columnSize + "px", background: "#fff", borderRadius: "5px", margin: "4px", @@ -568,7 +568,8 @@ export function createSearchAnnContent(dialogWindow: Window | undefined, popupDi styles: { background: anTo.annotationColor + "60", //width: "200px", height: (docHeight - 120) / rowSize - 60 + "px", - overflowY: "scroll", + overflowY: "overlay", + overflowX: "overlay", // 预览导出的注释内容显示不全,希望可以增加窗口拖动条 #93 }, properties: { innerHTML: (await getAnnotationContent(anTo)).replaceAll( diff --git a/src/modules/RelationHeader.tsx b/src/modules/RelationHeader.tsx index 762f9310..354111d7 100644 --- a/src/modules/RelationHeader.tsx +++ b/src/modules/RelationHeader.tsx @@ -365,7 +365,7 @@ async function createRelatedContent(anKey: string, win: Window | undefined, div: styles: { background: anTo.annotationColor + "60", //width: "200px", maxHeight: "100px", - overflowY: "scroll", + overflowY: "overlay", }, properties: { innerHTML: await getAnnotationContent(anTo) }, }, @@ -472,7 +472,7 @@ async function createRelatedDialog(readerDoc: Document, anKey: string) { maxHeight: mainWindow.innerHeight - 40 + "px", maxWidth: Math.max(mainWindow.outerWidth - left - 100, 1000) + "px", flexWrap: "wrap", - overflowY: "scroll", + overflowY: "overlay", }, }) // .addButton("Confirm", "confirm") diff --git a/src/modules/highlightWords.tsx b/src/modules/highlightWords.tsx index 90f457f1..0c25fc9d 100644 --- a/src/modules/highlightWords.tsx +++ b/src/modules/highlightWords.tsx @@ -474,7 +474,7 @@ function readerToolbarCallback(event: Parameters<_ZoteroTypes.Reader.EventHandle styles: { width: "100%", height: "5em", - overflowY: "scroll", + overflowY: "overlay", }, properties: { value: searchText, diff --git a/src/modules/menu.tsx b/src/modules/menu.tsx index 6fbe974e..d8175489 100644 --- a/src/modules/menu.tsx +++ b/src/modules/menu.tsx @@ -326,7 +326,7 @@ function buildMenu(collectionOrItem: "collection" | "item") { // maxHeight: Math.max(mainWindow.innerHeight*0.9,700) + "px", // maxWidth: Math.max(mainWindow.outerWidth -180, 700) + "px", flexWrap: "wrap", - overflowY: "scroll", + overflowY: "overlay", }, }, ]); diff --git a/src/utils/zzlb.ts b/src/utils/zzlb.ts index 253979c2..7aa8ac45 100644 --- a/src/utils/zzlb.ts +++ b/src/utils/zzlb.ts @@ -456,7 +456,7 @@ export function createTopDiv( zIndex: "9999", maxWidth: "calc(100% - 300px)", maxHeight: "600px", - overflowY: "scroll", + overflowY: "overlay", display: "flex", boxShadow: "#999999 0px 0px 4px 3px", background: "white",