mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-23 01:50:12 +01:00
This commit is contained in:
parent
be8102d9a9
commit
fd95ae295c
2 changed files with 5 additions and 2 deletions
|
|
@ -150,11 +150,14 @@ export const countSelectWord = (range: Range, rootID?: string) => {
|
||||||
/// #endif
|
/// #endif
|
||||||
};
|
};
|
||||||
|
|
||||||
export const countBlockWord = (ids: string[], rootID?: string) => {
|
export const countBlockWord = (ids: string[], rootID?: string, clearCache = false) => {
|
||||||
/// #if !MOBILE
|
/// #if !MOBILE
|
||||||
if (document.getElementById("status").classList.contains("fn__none")) {
|
if (document.getElementById("status").classList.contains("fn__none")) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
if (clearCache) {
|
||||||
|
countRootId = ""
|
||||||
|
}
|
||||||
if (ids.length > 0) {
|
if (ids.length > 0) {
|
||||||
fetchPost("/api/block/getBlocksWordCount", {ids}, (response) => {
|
fetchPost("/api/block/getBlocksWordCount", {ids}, (response) => {
|
||||||
renderStatusbarCounter(response.data);
|
renderStatusbarCounter(response.data);
|
||||||
|
|
|
||||||
|
|
@ -72,7 +72,7 @@ const promiseTransaction = () => {
|
||||||
lockFile(protyle.block.rootID);
|
lockFile(protyle.block.rootID);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
countBlockWord([], protyle.block.rootID);
|
countBlockWord([], protyle.block.rootID, true);
|
||||||
if (doOperations.length === 1 && (doOperations[0].action === "unfoldHeading" || doOperations[0].action === "foldHeading" || doOperations[0].action === "setAttrs")) {
|
if (doOperations.length === 1 && (doOperations[0].action === "unfoldHeading" || doOperations[0].action === "foldHeading" || doOperations[0].action === "setAttrs")) {
|
||||||
const gutterFoldElement = protyle.gutter.element.querySelector('[data-type="fold"]');
|
const gutterFoldElement = protyle.gutter.element.querySelector('[data-type="fold"]');
|
||||||
if (gutterFoldElement) {
|
if (gutterFoldElement) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue