mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-22 17:40:13 +01:00
This commit is contained in:
parent
8c36764686
commit
8f03464726
2 changed files with 3 additions and 1 deletions
|
|
@ -137,12 +137,14 @@ export const renameAsset = (assetPath: string) => {
|
||||||
fetchPost("/api/asset/renameAsset", {oldPath: assetPath, newName: inputElement.value}, (response) => {
|
fetchPost("/api/asset/renameAsset", {oldPath: assetPath, newName: inputElement.value}, (response) => {
|
||||||
getAllModels().asset.forEach(item => {
|
getAllModels().asset.forEach(item => {
|
||||||
if (item.path === assetPath) {
|
if (item.path === assetPath) {
|
||||||
|
item.path = response.data.newPath;
|
||||||
item.parent.updateTitle(getDisplayName(response.data.newPath));
|
item.parent.updateTitle(getDisplayName(response.data.newPath));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
getAllEditor().forEach(item => {
|
getAllEditor().forEach(item => {
|
||||||
item.reload(false);
|
item.reload(false);
|
||||||
});
|
});
|
||||||
|
dialog.destroy();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -67,7 +67,7 @@ export class Tab {
|
||||||
this.headElement.setAttribute("aria-label", escapeGreat(response.data));
|
this.headElement.setAttribute("aria-label", escapeGreat(response.data));
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
this.headElement.setAttribute("aria-label", escapeGreat(options.title));
|
this.headElement.setAttribute("aria-label", escapeGreat(this.title));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
this.headElement.addEventListener("dragstart", (event: DragEvent & { target: HTMLElement }) => {
|
this.headElement.addEventListener("dragstart", (event: DragEvent & { target: HTMLElement }) => {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue