mirror of
https://github.com/koodo-reader/koodo-reader.git
synced 2026-06-19 13:20:50 -04:00
fix bug
This commit is contained in:
2
src/assets/lib/kookit.min.js
vendored
2
src/assets/lib/kookit.min.js
vendored
File diff suppressed because one or more lines are too long
@@ -285,8 +285,10 @@ class Viewer extends React.Component<ViewerProps, ViewerState> {
|
||||
}
|
||||
}
|
||||
if (this.state.isDisablePopup) return;
|
||||
let selection = doc!.getSelection();
|
||||
if (!selection || selection.rangeCount === 0) return;
|
||||
|
||||
var rect = doc!.getSelection()!.getRangeAt(0).getBoundingClientRect();
|
||||
var rect = selection.getRangeAt(0).getBoundingClientRect();
|
||||
this.setState({ rect });
|
||||
});
|
||||
doc.addEventListener("contextmenu", (event) => {
|
||||
@@ -299,9 +301,12 @@ class Viewer extends React.Component<ViewerProps, ViewerState> {
|
||||
if (
|
||||
!doc!.getSelection() ||
|
||||
doc!.getSelection()!.toString().trim().length === 0
|
||||
)
|
||||
) {
|
||||
return;
|
||||
var rect = doc!.getSelection()!.getRangeAt(0).getBoundingClientRect();
|
||||
}
|
||||
let selection = doc!.getSelection();
|
||||
if (!selection || selection.rangeCount === 0) return;
|
||||
var rect = selection.getRangeAt(0).getBoundingClientRect();
|
||||
this.setState({ rect });
|
||||
});
|
||||
};
|
||||
|
||||
@@ -10,7 +10,7 @@ import Lottie from "react-lottie";
|
||||
import animationSuccess from "../../assets/lotties/success.json";
|
||||
import toast, { Toaster } from "react-hot-toast";
|
||||
import ConfigService from "../../utils/storage/configService";
|
||||
import * as Kookit from "../../assets/lib/kookit.min.js";
|
||||
import * as Kookit from "../../assets/lib/kookit.min";
|
||||
import { BookHelper } from "../../assets/lib/kookit-extra-browser.min";
|
||||
declare var window: any;
|
||||
const successOptions = {
|
||||
|
||||
@@ -55,7 +55,7 @@ export const backup = async (service: string): Promise<Boolean> => {
|
||||
return true;
|
||||
} else {
|
||||
const { SyncUtil } = await import(
|
||||
"../../assets/lib/kookit-extra-browser.min.js"
|
||||
"../../assets/lib/kookit-extra-browser.min"
|
||||
);
|
||||
let tokenConfig = getCloudConfig(service);
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { SqlStatement } from "../../assets/lib/kookit-extra-browser.min.js";
|
||||
import { SqlStatement } from "../../assets/lib/kookit-extra-browser.min";
|
||||
declare var window: any;
|
||||
function addColonToKeys(obj: any): any {
|
||||
const newObj: any = {};
|
||||
|
||||
@@ -4,7 +4,7 @@ export const handleLinkJump = async (event: any, rendition: any = {}) => {
|
||||
let href;
|
||||
if (event.target) {
|
||||
href =
|
||||
(event.target.innerText.startsWith("http") && event.target.innerText) ||
|
||||
(event.target.innerText && event.target.innerText.startsWith("http")) ||
|
||||
event.target.getAttribute("href") ||
|
||||
event.target.getAttribute("src") ||
|
||||
(event.target.parentNode &&
|
||||
|
||||
@@ -37,7 +37,7 @@ class styleUtil {
|
||||
}
|
||||
// get default css for iframe
|
||||
static getDefaultCss() {
|
||||
return `::selection{background:#f3a6a68c}::-moz-selection{background:#f3a6a68c}.kookit-note:hover{cursor:pointer;}img{max-width:100% !important}.kookit-text{${this.getCustomCss()}}code,pre{white-space: pre-wrap;}`;
|
||||
return `::selection{background:#f3a6a68c}::-moz-selection{background:#f3a6a68c}.kookit-note:hover{cursor:pointer;}.kookit-text{${this.getCustomCss()}}code,pre{white-space: pre-wrap;}`;
|
||||
}
|
||||
//force horionztal writing mode
|
||||
static getCustomCss() {
|
||||
|
||||
Reference in New Issue
Block a user