mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-05-15 16:41:07 +08:00
🎨 The outline item in the outline panel supports dragging to adjust the level and position https://github.com/siyuan-note/siyuan/issues/7957
This commit is contained in:
parent
611f6e2da0
commit
f2f112cebe
@ -64,13 +64,17 @@ func (tx *Transaction) doMoveOutlineHeading(operation *Operation) (ret *TxErr) {
|
||||
previousHeadingChildren := treenode.HeadingChildren(previousHeading)
|
||||
if 0 < len(previousHeadingChildren) {
|
||||
for _, child := range previousHeadingChildren {
|
||||
targetNode = child
|
||||
if child.ID == headingID {
|
||||
break
|
||||
}
|
||||
targetNode = child
|
||||
}
|
||||
}
|
||||
|
||||
if targetNode == heading.Previous {
|
||||
return
|
||||
}
|
||||
|
||||
diffLevel := heading.HeadingLevel - previousHeading.HeadingLevel
|
||||
heading.HeadingLevel = previousHeading.HeadingLevel
|
||||
|
||||
@ -92,10 +96,16 @@ func (tx *Transaction) doMoveOutlineHeading(operation *Operation) (ret *TxErr) {
|
||||
parentHeadingChildren := treenode.HeadingChildren(parentHeading)
|
||||
if 0 < len(parentHeadingChildren) {
|
||||
for _, child := range parentHeadingChildren {
|
||||
targetNode = child
|
||||
if child.ID == headingID {
|
||||
break
|
||||
}
|
||||
targetNode = child
|
||||
}
|
||||
}
|
||||
|
||||
if targetNode == heading.Previous {
|
||||
if parentHeading.HeadingLevel < heading.HeadingLevel {
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user