This commit is contained in:
Vanessa 2023-03-22 17:58:11 +08:00
parent 8747ca3a87
commit df502ec42a
2 changed files with 11 additions and 6 deletions

View file

@ -36,7 +36,7 @@
} }
&--refcount { &--refcount {
right: -26px; right: -20px;
top: 18px; top: 18px;
position: absolute; position: absolute;
line-height: 16px; line-height: 16px;

View file

@ -574,19 +574,24 @@ export class Backlink extends Model {
if (data.mentionsCount === 0) { if (data.mentionsCount === 0) {
this.status[this.blockId].backlinkMStatus = 3; this.status[this.blockId].backlinkMStatus = 3;
} else { } else {
Array.from({length: window.siyuan.config.editor.backlinkExpandCount}).forEach((item, index) => { Array.from({length: window.siyuan.config.editor.backmentionExpandCount}).forEach((item, index) => {
if (data.backmentions[index]) { if (data.backmentions[index]) {
this.status[this.blockId].backlinkMOpenIds.push(data.backmentions[index].id); this.status[this.blockId].backlinkMOpenIds.push(data.backmentions[index].id);
} }
}); });
if (window.siyuan.config.editor.backmentionExpandCount === 0) {
// 设置为 0 时需折叠
this.status[this.blockId].backlinkMStatus = 3;
} else {
if (data.linkRefsCount === 0) { if (data.linkRefsCount === 0) {
this.status[this.blockId].backlinkMStatus = 0; this.status[this.blockId].backlinkMStatus = 0;
} else { } else {
this.status[this.blockId].backlinkMStatus = 1; this.status[this.blockId].backlinkMStatus = 1;
} }
} }
}
if (data.linkRefsCount > 0) { if (data.linkRefsCount > 0) {
Array.from({length: window.siyuan.config.editor.backmentionExpandCount}).forEach((item, index) => { Array.from({length: window.siyuan.config.editor.backlinkExpandCount}).forEach((item, index) => {
if (data.backlinks[index]) { if (data.backlinks[index]) {
this.status[this.blockId].backlinkOpenIds.push(data.backlinks[index].id); this.status[this.blockId].backlinkOpenIds.push(data.backlinks[index].id);
} }