mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-22 17:40:13 +01:00
This commit is contained in:
parent
59aa3fc383
commit
a2ffb2a21c
3 changed files with 8 additions and 2 deletions
|
|
@ -466,6 +466,9 @@ export class Backlink extends Model {
|
||||||
if (!this.blockId) {
|
if (!this.blockId) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
this.editors.forEach(item => {
|
||||||
|
item.destroy();
|
||||||
|
})
|
||||||
const element = this.element.querySelector('.block__icon[data-type="refresh"] svg');
|
const element = this.element.querySelector('.block__icon[data-type="refresh"] svg');
|
||||||
element.classList.add("fn__rotate");
|
element.classList.add("fn__rotate");
|
||||||
fetchPost("/api/ref/refreshBacklink", {
|
fetchPost("/api/ref/refreshBacklink", {
|
||||||
|
|
|
||||||
|
|
@ -31,7 +31,7 @@ export const reloadProtyle = (protyle: IProtyle, focus: boolean) => {
|
||||||
const isMention = protyle.element.getAttribute("data-ismention") === "true";
|
const isMention = protyle.element.getAttribute("data-ismention") === "true";
|
||||||
const tabElement = hasClosestByClassName(protyle.element, "sy__backlink");
|
const tabElement = hasClosestByClassName(protyle.element, "sy__backlink");
|
||||||
if (tabElement) {
|
if (tabElement) {
|
||||||
const inputsElement = tabElement.querySelectorAll(".b3-form__icon-input") as NodeListOf<HTMLInputElement>;
|
const inputsElement = tabElement.querySelectorAll(".b3-text-field") as NodeListOf<HTMLInputElement>;
|
||||||
fetchPost(isMention ? "/api/ref/getBackmentionDoc" : "/api/ref/getBacklinkDoc", {
|
fetchPost(isMention ? "/api/ref/getBackmentionDoc" : "/api/ref/getBacklinkDoc", {
|
||||||
defID: protyle.element.getAttribute("data-defid"),
|
defID: protyle.element.getAttribute("data-defid"),
|
||||||
refTreeID: protyle.block.rootID,
|
refTreeID: protyle.block.rootID,
|
||||||
|
|
|
||||||
|
|
@ -738,7 +738,10 @@ export const onTransaction = (protyle: IProtyle, operation: IOperation, isUndo:
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (operation.action === "append") {
|
if (operation.action === "append") {
|
||||||
reloadProtyle(protyle, false);
|
// 目前只有移动块的时候会调用,反连面板就自己点击刷新处理。
|
||||||
|
if (!protyle.options.backlinkData) {
|
||||||
|
reloadProtyle(protyle, false);
|
||||||
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (["addAttrViewCol", "insertAttrViewBlock", "updateAttrViewCol", "updateAttrViewColOptions",
|
if (["addAttrViewCol", "insertAttrViewBlock", "updateAttrViewCol", "updateAttrViewColOptions",
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue