This commit is contained in:
Vanessa 2022-06-07 14:52:30 +08:00
parent d5548021af
commit 785cb50e85
2 changed files with 13 additions and 10 deletions

View file

@ -44,17 +44,16 @@ export class Tab {
this.headElement.addEventListener("mouseenter", (event) => { this.headElement.addEventListener("mouseenter", (event) => {
event.stopPropagation(); event.stopPropagation();
event.preventDefault(); event.preventDefault();
if (!(this.model as Editor).editor) { if (this.model instanceof Editor && this.model.editor?.protyle?.block?.rootID) {
return; fetchPost("/api/filetree/getFullHPathByID", {
id: (this.model as Editor).editor.protyle.block.rootID
}, (response) => {
if (!this.headElement.getAttribute("aria-label")) {
showTooltip(escapeHtml(response.data), this.headElement);
}
this.headElement.setAttribute("aria-label", escapeHtml(response.data));
});
} }
fetchPost("/api/filetree/getFullHPathByID", {
id: (this.model as Editor).editor.protyle.block.rootID
}, (response) => {
if (!this.headElement.getAttribute("aria-label")) {
showTooltip(escapeHtml(response.data), this.headElement);
}
this.headElement.setAttribute("aria-label", escapeHtml(response.data));
});
}); });
this.headElement.addEventListener("dragstart", (event: DragEvent & { target: HTMLElement }) => { this.headElement.addEventListener("dragstart", (event: DragEvent & { target: HTMLElement }) => {
window.getSelection().removeAllRanges(); window.getSelection().removeAllRanges();

View file

@ -43,6 +43,10 @@ const showAccountInfo = (modelElement: HTMLElement, modelMainElement: Element) =
<button class="b3-button b3-button--cancel" id="logout"> <button class="b3-button b3-button--cancel" id="logout">
${window.siyuan.languages.logout} ${window.siyuan.languages.logout}
</button> </button>
<span class="fn__space"></span>
<button class="b3-button b3-button--cancel" id="deactivateUser">
${window.siyuan.languages.deactivateUser}
</button>
<span class="fn__flex-1"></span> <span class="fn__flex-1"></span>
<button class="b3-button b3-button--cancel" id="refresh"> <button class="b3-button b3-button--cancel" id="refresh">
<svg><use xlink:href="#iconRefresh"></use></svg> <svg><use xlink:href="#iconRefresh"></use></svg>