mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-01-03 23:38:49 +01:00
🐛 Improve outline dnd https://github.com/siyuan-note/siyuan/issues/10828
This commit is contained in:
parent
52e1dd8b06
commit
577837894f
6 changed files with 26 additions and 5 deletions
|
|
@ -85,6 +85,14 @@ func (tx *Transaction) doMoveOutlineHeading(operation *Operation) (ret *TxErr) {
|
|||
return
|
||||
}
|
||||
|
||||
for _, h := range headingChildren {
|
||||
if h.ID == previousID {
|
||||
// 不能移动到自己的子标题下
|
||||
util.PushMsg(Conf.language(241), 5000)
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
targetNode := previousHeading
|
||||
previousHeadingChildren := treenode.HeadingChildren(previousHeading)
|
||||
if 0 < len(previousHeadingChildren) {
|
||||
|
|
@ -122,6 +130,14 @@ func (tx *Transaction) doMoveOutlineHeading(operation *Operation) (ret *TxErr) {
|
|||
return
|
||||
}
|
||||
|
||||
for _, h := range headingChildren {
|
||||
if h.ID == parentID {
|
||||
// 不能移动到自己的子标题下
|
||||
util.PushMsg(Conf.language(241), 5000)
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
targetNode := parentHeading
|
||||
parentHeadingChildren := treenode.HeadingChildren(parentHeading)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue