mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-09-22 08:30:42 +02: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
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)
|
app := arg["app"].(string)
|
||||||
session := arg["session"].(string)
|
session := arg["session"].(string)
|
||||||
if model.IsFoldHeading(&transactions) || model.IsUnfoldHeading(&transactions) {
|
|
||||||
model.WaitForWritingFiles()
|
|
||||||
}
|
|
||||||
pushTransactions(app, session, transactions)
|
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()
|
elapsed := time.Now().Sub(start).Milliseconds()
|
||||||
c.Header("Server-Timing", fmt.Sprintf("total;dur=%d", elapsed))
|
c.Header("Server-Timing", fmt.Sprintf("total;dur=%d", elapsed))
|
||||||
}
|
}
|
||||||
|
|
|
@ -154,7 +154,7 @@ func (tx *Transaction) doMoveOutlineHeading(operation *Operation) (ret *TxErr) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
util.PushReloadDoc(tree.Root.ID)
|
operation.RetData = tree.Root.ID
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -66,6 +66,17 @@ func IsUnfoldHeading(transactions *[]*Transaction) bool {
|
||||||
return false
|
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() {
|
func WaitForWritingFiles() {
|
||||||
var printLog bool
|
var printLog bool
|
||||||
var lastPrintLog bool
|
var lastPrintLog bool
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue