mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-18 07:30:12 +01:00
🎨 https://github.com/siyuan-note/siyuan/issues/15989 标题前删除需展开相关折叠的标题
This commit is contained in:
parent
1a821ee39b
commit
db31c47760
1 changed files with 9 additions and 8 deletions
|
|
@ -12,7 +12,7 @@ import {
|
||||||
import {transaction, turnsIntoOneTransaction, turnsIntoTransaction, updateTransaction} from "./transaction";
|
import {transaction, turnsIntoOneTransaction, turnsIntoTransaction, updateTransaction} from "./transaction";
|
||||||
import {cancelSB, genEmptyElement} from "../../block/util";
|
import {cancelSB, genEmptyElement} from "../../block/util";
|
||||||
import {listOutdent, updateListOrder} from "./list";
|
import {listOutdent, updateListOrder} from "./list";
|
||||||
import {zoomOut} from "../../menus/protyle";
|
import {setFold, zoomOut} from "../../menus/protyle";
|
||||||
import {preventScroll} from "../scroll/preventScroll";
|
import {preventScroll} from "../scroll/preventScroll";
|
||||||
import {hideElements} from "../ui/hideElements";
|
import {hideElements} from "../ui/hideElements";
|
||||||
import {Constants} from "../../constants";
|
import {Constants} from "../../constants";
|
||||||
|
|
@ -300,13 +300,14 @@ export const removeBlock = async (protyle: IProtyle, blockElement: Element, rang
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (blockType === "NodeHeading") {
|
if (blockType === "NodeHeading") {
|
||||||
if ((blockElement.previousElementSibling &&
|
if (blockElement.previousElementSibling &&
|
||||||
blockElement.previousElementSibling.getAttribute("data-type") === "NodeHeading" &&
|
blockElement.previousElementSibling.getAttribute("data-type") === "NodeHeading" &&
|
||||||
blockElement.previousElementSibling.getAttribute("fold") === "1") ||
|
blockElement.previousElementSibling.getAttribute("fold") === "1") {
|
||||||
(blockElement.getAttribute("data-type") === "NodeHeading" &&
|
setFold(protyle, blockElement.previousElementSibling, true, false, false);
|
||||||
blockElement.getAttribute("fold") === "1")) {
|
}
|
||||||
focusBlock(blockElement.previousElementSibling, undefined, false);
|
if (blockElement.getAttribute("data-type") === "NodeHeading" &&
|
||||||
return;
|
blockElement.getAttribute("fold") === "1") {
|
||||||
|
setFold(protyle, blockElement, true, false, false);
|
||||||
}
|
}
|
||||||
turnsIntoTransaction({
|
turnsIntoTransaction({
|
||||||
protyle: protyle,
|
protyle: protyle,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue