mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-16 22:50:13 +01:00
🐛 The insertion position is wrong after converting the list to paragraph block in the floating window https://github.com/siyuan-note/siyuan/issues/15396
This commit is contained in:
parent
27f412658b
commit
be684aee76
3 changed files with 62 additions and 0 deletions
|
|
@ -86,6 +86,31 @@ func getBlockSiblingID(c *gin.Context) {
|
|||
}
|
||||
}
|
||||
|
||||
func getBlockIDs(c *gin.Context) {
|
||||
ret := gulu.Ret.NewResult()
|
||||
defer c.JSON(http.StatusOK, ret)
|
||||
|
||||
arg, ok := util.JsonArg(c, ret)
|
||||
if !ok {
|
||||
return
|
||||
}
|
||||
|
||||
id := arg["id"].(string)
|
||||
parentID, previousID, nextID, err := model.GetBlockIDs(id)
|
||||
if nil != err {
|
||||
ret.Code = -1
|
||||
ret.Msg = err.Error()
|
||||
ret.Data = map[string]interface{}{"closeTimeout": 7000}
|
||||
return
|
||||
}
|
||||
|
||||
ret.Data = map[string]string{
|
||||
"parentID": parentID,
|
||||
"previousID": previousID,
|
||||
"nextID": nextID,
|
||||
}
|
||||
}
|
||||
|
||||
func transferBlockRef(c *gin.Context) {
|
||||
ret := gulu.Ret.NewResult()
|
||||
defer c.JSON(http.StatusOK, ret)
|
||||
|
|
|
|||
|
|
@ -217,6 +217,7 @@ func ServeAPI(ginServer *gin.Engine) {
|
|||
ginServer.Handle("POST", "/api/block/swapBlockRef", model.CheckAuth, model.CheckAdminRole, model.CheckReadonly, swapBlockRef)
|
||||
ginServer.Handle("POST", "/api/block/transferBlockRef", model.CheckAuth, model.CheckAdminRole, model.CheckReadonly, transferBlockRef)
|
||||
ginServer.Handle("POST", "/api/block/getBlockSiblingID", model.CheckAuth, getBlockSiblingID)
|
||||
ginServer.Handle("POST", "/api/block/getBlockIDs", model.CheckAuth, getBlockIDs)
|
||||
ginServer.Handle("POST", "/api/block/getBlockTreeInfos", model.CheckAuth, getBlockTreeInfos)
|
||||
ginServer.Handle("POST", "/api/block/checkBlockRef", model.CheckAuth, checkBlockRef)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue