|
@@ -883,7 +883,7 @@ export const turnsIntoTransaction = (options: {
|
|
|
selectsElement.forEach((item, index) => {
|
|
|
if ((options.type === "Blocks2Ps" || options.type === "Blocks2Hs") &&
|
|
|
item.getAttribute("data-type") === "NodeHeading" && item.getAttribute("fold") === "1") {
|
|
|
- setFold(options.protyle, item);
|
|
|
+ setFold(options.protyle, item, undefined, undefined, false);
|
|
|
}
|
|
|
item.classList.remove("protyle-wysiwyg--select");
|
|
|
item.removeAttribute("select-start");
|
|
@@ -1105,18 +1105,20 @@ export const transaction = (protyle: IProtyle, doOperations: IOperation[], undoO
|
|
|
protyle.model.headElement.classList.remove("item--unupdate");
|
|
|
}
|
|
|
protyle.updated = true;
|
|
|
-
|
|
|
if (needDebounce) {
|
|
|
protyle.undo.replace(doOperations, protyle);
|
|
|
} else {
|
|
|
protyle.undo.add(doOperations, undoOperations, protyle);
|
|
|
}
|
|
|
}
|
|
|
+ window.clearTimeout(transactionsTimeout);
|
|
|
// 加速折叠 https://github.com/siyuan-note/siyuan/issues/11828
|
|
|
if (doOperations.length === 1 && (
|
|
|
doOperations[0].action === "unfoldHeading" ||
|
|
|
(doOperations[0].action === "setAttrs" && doOperations[0].data.startsWith('{"fold":'))
|
|
|
)) {
|
|
|
+ // 防止 needDebounce 为 true
|
|
|
+ protyle.transactionTime = time + Constants.TIMEOUT_INPUT * 2;
|
|
|
fetchPost("/api/transactions", {
|
|
|
session: protyle.id,
|
|
|
app: Constants.SIYUAN_APPID,
|
|
@@ -1157,7 +1159,6 @@ export const transaction = (protyle: IProtyle, doOperations: IOperation[], undoO
|
|
|
});
|
|
|
}
|
|
|
protyle.transactionTime = time;
|
|
|
- window.clearTimeout(transactionsTimeout);
|
|
|
transactionsTimeout = window.setTimeout(() => {
|
|
|
promiseTransaction();
|
|
|
}, Constants.TIMEOUT_INPUT * 2);
|