Skip to content

Commit

Permalink
fix bug
Browse files Browse the repository at this point in the history
  • Loading branch information
troyeguo committed Oct 29, 2023
1 parent 767e37d commit 77c9070
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 15 deletions.
10 changes: 5 additions & 5 deletions public/lib/kookit/kookit.min.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions src/components/dialogs/actionDialog/actionDialog.css
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,14 @@
border-radius: 5px;
overflow: hidden;
overflow-x: hidden;
padding-bottom: 5px;
}

.action-dialog-actions-container {
font-size: 15px;
text-align: center;
line-height: 14px;
opacity: 1;
margin-top: 5px;
padding: 5px;
/* position: absolute;
top: 83px;
left: 29px; */
Expand All @@ -31,6 +30,7 @@
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
padding-left: 10px;
}

.action-name {
Expand Down
6 changes: 2 additions & 4 deletions src/components/dialogs/sortDialog/sortDialog.css
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,15 @@
opacity: 1;
position: absolute;
left: 425px;
padding-bottom: 5px;
padding: 5px;
top: 65px;
z-index: 5;
border-radius: 5px;
transition: all 0.1s ease;
overflow: hidden;
animation: popup 0.1s ease-in-out 0s 1;
}
.sort-by-category {
margin-top: 4px;
}

.sort-by-category-list,
.sort-by-order-list {
font-size: 15px;
Expand Down
15 changes: 13 additions & 2 deletions src/components/popups/popupMenu/component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,16 @@ class PopupMenu extends React.Component<PopupMenuProps, PopupMenuStates> {
document
.querySelector(".ebook-viewer")
?.setAttribute("style", "height:100%; overflow: hidden;");

let doc: any = getPDFIframeDoc();
if (rect.bottom < doc.document.body.scrollHeight - 188) {
console.log(rect, doc.document.body, doc.document.body.scrollHeight);
if (
doc.document.body.scrollHeight - rect.top - rect.height < 188 &&
rect.top < 188
) {
this.props.handleChangeDirection(true);
posY = rect.top + 16;
} else if (rect.bottom < doc.document.body.scrollHeight - 188) {
this.props.handleChangeDirection(true);
posY = posY + 16;
} else {
Expand All @@ -75,7 +83,10 @@ class PopupMenu extends React.Component<PopupMenuProps, PopupMenuStates> {
getHtmlPosition(rect: any) {
let posY = rect.bottom - this.props.rendition.getPageSize().scrollTop;
let posX = rect.left + rect.width / 2;
if (
if (this.props.rendition.getPageSize().height - rect.height < 188) {
this.props.handleChangeDirection(true);
posY = rect.top + 16 + this.props.rendition.getPageSize().top;
} else if (
posY <
this.props.rendition.getPageSize().height -
188 +
Expand Down
6 changes: 5 additions & 1 deletion src/containers/htmlViewer/component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,11 @@ class Viewer extends React.Component<ViewerProps, ViewerState> {
this.props.handleRenderBookFunc(this.handleRenderBook);

window.addEventListener("resize", () => {
BookUtil.reloadBooks();
if (StorageUtil.getReaderConfig("isFullscreen") === "yes") {
this.handleRenderBook();
} else {
BookUtil.reloadBooks();
}
});
}
handlePageWidth = () => {
Expand Down
2 changes: 1 addition & 1 deletion src/containers/sidebar/component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ class Sidebar extends React.Component<SidebarProps, SidebarState> {
{this.state.index === index && this.props.mode !== "shelf" ? (
<div className="side-menu-selector-container"></div>
) : null}
{this.state.hoverIndex === index && this.props.mode !== "shelf" ? (
{this.state.hoverIndex === index ? (
<div className="side-menu-hover-container"></div>
) : null}
<div
Expand Down

0 comments on commit 77c9070

Please sign in to comment.