mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-01-04 15:58:49 +01: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
0234549a93
commit
30621f6ecf
1 changed files with 13 additions and 1 deletions
|
|
@ -54,8 +54,9 @@ func (tx *Transaction) doMoveOutlineHeading(operation *Operation) (ret *TxErr) {
|
|||
})
|
||||
|
||||
headingChildren := treenode.HeadingChildren(heading)
|
||||
var tmp []*ast.Node
|
||||
|
||||
// 过滤掉超级块结束节点
|
||||
var tmp []*ast.Node
|
||||
for _, child := range headingChildren {
|
||||
if ast.NodeSuperBlockCloseMarker == child.Type {
|
||||
continue
|
||||
|
|
@ -103,6 +104,17 @@ func (tx *Transaction) doMoveOutlineHeading(operation *Operation) (ret *TxErr) {
|
|||
|
||||
targetNode := parentHeading
|
||||
parentHeadingChildren := treenode.HeadingChildren(parentHeading)
|
||||
|
||||
// 找到下方第一个非标题节点
|
||||
tmp = nil
|
||||
for _, child := range parentHeadingChildren {
|
||||
if ast.NodeHeading == child.Type {
|
||||
break
|
||||
}
|
||||
tmp = append(tmp, child)
|
||||
}
|
||||
parentHeadingChildren = tmp
|
||||
|
||||
if 0 < len(parentHeadingChildren) {
|
||||
for _, child := range parentHeadingChildren {
|
||||
if child.ID == headingID {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue