🎨 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
30621f6ecf
commit
4fb311de68
3 changed files with 20 additions and 4 deletions
|
@ -70,11 +70,16 @@ func performTransactions(c *gin.Context) {
|
|||
|
||||
app := arg["app"].(string)
|
||||
session := arg["session"].(string)
|
||||
if model.IsFoldHeading(&transactions) || model.IsUnfoldHeading(&transactions) {
|
||||
model.WaitForWritingFiles()
|
||||
}
|
||||
pushTransactions(app, session, transactions)
|
||||
|
||||
if model.IsFoldHeading(&transactions) || model.IsUnfoldHeading(&transactions) || model.IsMoveOutlineHeading(&transactions) {
|
||||
if model.IsMoveOutlineHeading(&transactions) {
|
||||
if retData := transactions[0].DoOperations[0].RetData; nil != retData {
|
||||
util.PushReloadDoc(retData.(string))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
elapsed := time.Now().Sub(start).Milliseconds()
|
||||
c.Header("Server-Timing", fmt.Sprintf("total;dur=%d", elapsed))
|
||||
}
|
||||
|
|
|
@ -154,7 +154,7 @@ func (tx *Transaction) doMoveOutlineHeading(operation *Operation) (ret *TxErr) {
|
|||
return
|
||||
}
|
||||
|
||||
util.PushReloadDoc(tree.Root.ID)
|
||||
operation.RetData = tree.Root.ID
|
||||
return
|
||||
}
|
||||
|
||||
|
|
|
@ -66,6 +66,17 @@ func IsUnfoldHeading(transactions *[]*Transaction) bool {
|
|||
return false
|
||||
}
|
||||
|
||||
func IsMoveOutlineHeading(transactions *[]*Transaction) bool {
|
||||
for _, tx := range *transactions {
|
||||
for _, op := range tx.DoOperations {
|
||||
if "moveOutlineHeading" == op.Action {
|
||||
return true
|
||||
}
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
func WaitForWritingFiles() {
|
||||
var printLog bool
|
||||
var lastPrintLog bool
|
||||
|
|
Loading…
Add table
Reference in a new issue