Skip to content

Commit

Permalink
fix bug
Browse files Browse the repository at this point in the history
  • Loading branch information
troyeguo committed Apr 16, 2023
1 parent 9a0259f commit c585eb4
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 22 deletions.
5 changes: 1 addition & 4 deletions src/components/textToSpeech/component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -126,10 +126,7 @@ class TextToSpeech extends React.Component<
};
async handleRead() {
let text = this.state.nodeList[this.state.nodeIndex];
let style =
"background: " +
(StorageUtil.getReaderConfig("backgroundColor") || "#f3a6a68c");
console.log(text, style);
let style = "background: #f3a6a68c";
this.props.htmlBook.rendition.highlightNode(text, style);
text = text
.replace(/\s\s/g, "")
Expand Down
18 changes: 0 additions & 18 deletions src/containers/panels/operationPanel/component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import { withRouter } from "react-router-dom";
import toast from "react-hot-toast";
import { HtmlMouseEvent } from "../../../utils/serviceUtils/mouseEvent";
import storageUtil from "../../../utils/serviceUtils/storageUtil";
import { getIframeDoc } from "../../../utils/serviceUtils/docUtil";
import EdgeUtil from "../../../utils/serviceUtils/edgeUtil";
declare var document: any;

Expand Down Expand Up @@ -57,23 +56,6 @@ class OperationPanel extends React.Component<
storageUtil.getReaderConfig("readerMode")
);
});
let doc = getIframeDoc();
if (!doc) return;
doc.addEventListener("keydown", (event) => {
if (event.keyCode === 27) {
this.handleExit();
}
});
document.addEventListener("keydown", (event) => {
if (event.keyCode === 27) {
this.handleExit();
}
});
window.addEventListener("keydown", (event) => {
if (event.keyCode === 27) {
this.handleExit();
}
});
}
handleShortcut() {}
// 点击切换全屏按钮触发
Expand Down

0 comments on commit c585eb4

Please sign in to comment.