fix: allow returning from resource tabs

This commit is contained in:
lix-2026
2026-05-20 17:00:17 +08:00
parent bdc05c1d27
commit bbd9dab701
3 changed files with 44 additions and 10 deletions
+9 -10
View File
@@ -7486,17 +7486,16 @@ const SIDEBAR_TREE_JS: &str = r##"
openEditorAttachmentLink(editorAttachmentLink);
}
window.addEventListener('mousedown', interceptEditorAttachmentLink, true);
window.addEventListener('click', interceptEditorAttachmentLink, true);
document.addEventListener('click', function(e) {
var editorAttachmentLink = closestAction(e.target, '.editor-surface .ProseMirror a[data-mnote-attachment-link="true"], .editor-surface .ProseMirror a.mnote-uploaded-attachment-row');
function suppressEditorAttachmentLinkDefault(event) {
var editorAttachmentLink = closestAction(event.target, '.editor-surface .ProseMirror a[data-mnote-attachment-link="true"], .editor-surface .ProseMirror a.mnote-uploaded-attachment-row');
if (!(editorAttachmentLink instanceof HTMLAnchorElement)) return;
e.preventDefault();
e.stopPropagation();
if (typeof e.stopImmediatePropagation === 'function') e.stopImmediatePropagation();
openEditorAttachmentLink(editorAttachmentLink);
}, true);
event.preventDefault();
event.stopPropagation();
if (typeof event.stopImmediatePropagation === 'function') event.stopImmediatePropagation();
}
window.addEventListener('mousedown', suppressEditorAttachmentLinkDefault, true);
window.addEventListener('click', interceptEditorAttachmentLink, true);
document.addEventListener('mouseover', function(event) {
var link = closestAction(event.target, '.editor-surface .ProseMirror a[data-mnote-attachment-link="true"], .editor-surface .ProseMirror a.mnote-uploaded-attachment-row');