mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-22 09:30:14 +01:00
🚨
This commit is contained in:
parent
331368ce78
commit
3c8c66fbdd
5 changed files with 12 additions and 13 deletions
|
|
@ -129,7 +129,7 @@ export const initStatus = () => {
|
|||
/// #endif
|
||||
};
|
||||
|
||||
let countRootId: string
|
||||
let countRootId: string;
|
||||
export const countSelectWord = (range: Range, rootID?: string) => {
|
||||
/// #if !MOBILE
|
||||
if (document.getElementById("status").classList.contains("fn__none")) {
|
||||
|
|
@ -140,7 +140,7 @@ export const countSelectWord = (range: Range, rootID?: string) => {
|
|||
fetchPost("/api/block/getContentWordCount", {"content": range.toString()}, (response) => {
|
||||
renderStatusbarCounter(response.data);
|
||||
});
|
||||
countRootId = ""
|
||||
countRootId = "";
|
||||
} else if (rootID && rootID !== countRootId) {
|
||||
countRootId = rootID;
|
||||
fetchPost("/api/block/getTreeStat", {id: rootID}, (response) => {
|
||||
|
|
@ -156,15 +156,15 @@ export const countBlockWord = (ids: string[], rootID?: string, clearCache = fals
|
|||
return;
|
||||
}
|
||||
if (clearCache) {
|
||||
countRootId = ""
|
||||
countRootId = "";
|
||||
}
|
||||
if (ids.length > 0) {
|
||||
fetchPost("/api/block/getBlocksWordCount", {ids}, (response) => {
|
||||
renderStatusbarCounter(response.data);
|
||||
});
|
||||
countRootId = ""
|
||||
countRootId = "";
|
||||
} else if (rootID && rootID !== countRootId) {
|
||||
countRootId = rootID
|
||||
countRootId = rootID;
|
||||
fetchPost("/api/block/getTreeStat", {id: rootID}, (response) => {
|
||||
renderStatusbarCounter(response.data);
|
||||
});
|
||||
|
|
@ -173,7 +173,7 @@ export const countBlockWord = (ids: string[], rootID?: string, clearCache = fals
|
|||
};
|
||||
|
||||
export const clearCounter = () => {
|
||||
countRootId = ""
|
||||
countRootId = "";
|
||||
document.querySelector("#status .status__counter").innerHTML = "";
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -78,7 +78,7 @@ export const initKeyboardToolbar = () => {
|
|||
return;
|
||||
}
|
||||
if (type === "down") {
|
||||
moveToDown(protyle, nodeElement, range)
|
||||
moveToDown(protyle, nodeElement, range);
|
||||
focusByRange(range);
|
||||
return;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ export const readText = async () => {
|
|||
return window.JSAndroid.readClipboard();
|
||||
}
|
||||
return navigator.clipboard.readText();
|
||||
}
|
||||
};
|
||||
|
||||
export const writeText = async (text: string) => {
|
||||
let range: Range;
|
||||
|
|
|
|||
|
|
@ -32,12 +32,12 @@ import {matchHotKey} from "../util/hotKey";
|
|||
import {enter} from "./enter";
|
||||
import {fixTable} from "../util/table";
|
||||
import {
|
||||
transaction, turnsIntoOneTransaction, turnsIntoTransaction,
|
||||
turnsIntoOneTransaction, turnsIntoTransaction,
|
||||
updateBatchTransaction,
|
||||
updateTransaction
|
||||
} from "./transaction";
|
||||
import {fontEvent} from "../toolbar/Font";
|
||||
import {listIndent, listOutdent, updateListOrder} from "./list";
|
||||
import {listIndent, listOutdent} from "./list";
|
||||
import {newFileBySelect, newFileContentBySelect, rename, replaceFileName} from "../../editor/rename";
|
||||
import {insertEmptyBlock, jumpToParentNext} from "../../block/util";
|
||||
import {isLocalPath} from "../../util/pathName";
|
||||
|
|
@ -49,7 +49,6 @@ import {linkMenu, refMenu, setFold, zoomOut} from "../../menus/protyle";
|
|||
import {removeEmbed} from "./removeEmbed";
|
||||
import {openAttr} from "../../menus/commonMenuItem";
|
||||
import {Constants} from "../../constants";
|
||||
import {preventScroll} from "../scroll/preventScroll";
|
||||
import {bindMenuKeydown} from "../../menus/Menu";
|
||||
import {fetchPost} from "../../util/fetch";
|
||||
import {onGet} from "../util/onGet";
|
||||
|
|
|
|||
|
|
@ -93,7 +93,7 @@ export const moveToUp = (protyle:IProtyle, nodeElement:HTMLElement, range:Range
|
|||
}
|
||||
preventScroll(protyle);
|
||||
scrollCenter(protyle);
|
||||
}
|
||||
};
|
||||
|
||||
export const moveToDown = (protyle:IProtyle, nodeElement:HTMLElement, range:Range) => {
|
||||
let nextElement: Element;
|
||||
|
|
@ -180,4 +180,4 @@ export const moveToDown = (protyle:IProtyle, nodeElement:HTMLElement, range:Ran
|
|||
}
|
||||
preventScroll(protyle);
|
||||
scrollCenter(protyle);
|
||||
}
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue