🎨 改进块引计数浮窗显示逻辑 https://github.com/siyuan-note/siyuan/issues/6853

This commit is contained in:
Liang Ding 2022-12-24 12:05:55 +08:00
parent a20a338e6d
commit 2eb3e8ffc7
No known key found for this signature in database
GPG key ID: 136F30F901A2231D
3 changed files with 91 additions and 70 deletions

View file

@ -705,8 +705,13 @@ func getDoc(c *gin.Context) {
endID = endIDArg.(string)
size = 36
}
isBacklinkArg := arg["isBacklink"]
isBacklink := false
if nil != isBacklinkArg {
isBacklink = isBacklinkArg.(bool)
}
blockCount, childBlockCount, content, parentID, parent2ID, rootID, typ, eof, boxID, docPath, err := model.GetDoc(startID, endID, id, index, keyword, mode, size)
blockCount, childBlockCount, content, parentID, parent2ID, rootID, typ, eof, boxID, docPath, isBacklinkExpand, err := model.GetDoc(startID, endID, id, index, keyword, mode, size, isBacklink)
if errors.Is(err, filelock.ErrUnableAccessFile) {
ret.Code = 2
ret.Data = id
@ -727,19 +732,20 @@ func getDoc(c *gin.Context) {
isSyncing := model.IsSyncingFile(rootID)
ret.Data = map[string]interface{}{
"id": id,
"mode": mode,
"parentID": parentID,
"parent2ID": parent2ID,
"rootID": rootID,
"type": typ,
"content": content,
"blockCount": blockCount,
"childBlockCount": childBlockCount,
"eof": eof,
"box": boxID,
"path": docPath,
"isSyncing": isSyncing,
"id": id,
"mode": mode,
"parentID": parentID,
"parent2ID": parent2ID,
"rootID": rootID,
"type": typ,
"content": content,
"blockCount": blockCount,
"childBlockCount": childBlockCount,
"eof": eof,
"box": boxID,
"path": docPath,
"isSyncing": isSyncing,
"isBacklinkExpand": isBacklinkExpand,
}
}