Skip to content

Commit

Permalink
overflowY: "overlay" 改进滚动条
Browse files Browse the repository at this point in the history
  • Loading branch information
zzlb0224 committed Aug 11, 2024
1 parent 3f8194a commit d57bbe5
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 10 deletions.
3 changes: 1 addition & 2 deletions src/action/action-searchWords2.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
3 changes: 2 additions & 1 deletion src/component/PopupRoot.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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",
}}
>
Expand Down
5 changes: 3 additions & 2 deletions src/modules/AnnotationsToNote.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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(
Expand Down
4 changes: 2 additions & 2 deletions src/modules/RelationHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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) },
},
Expand Down Expand Up @@ -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")
Expand Down
2 changes: 1 addition & 1 deletion src/modules/highlightWords.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -474,7 +474,7 @@ function readerToolbarCallback(event: Parameters<_ZoteroTypes.Reader.EventHandle
styles: {
width: "100%",
height: "5em",
overflowY: "scroll",
overflowY: "overlay",
},
properties: {
value: searchText,
Expand Down
2 changes: 1 addition & 1 deletion src/modules/menu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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",
},
},
]);
Expand Down
2 changes: 1 addition & 1 deletion src/utils/zzlb.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit d57bbe5

Please sign in to comment.