mobile fixes
This commit is contained in:
@@ -1059,10 +1059,15 @@ export function startNoteEditor(adapter) {
|
||||
if (!event.matches) setHeaderMenuOpen(false);
|
||||
});
|
||||
const mobileEditorOptions = document.querySelector("#mobile-editor-options");
|
||||
const markdownMore = document.querySelector(".markdown-more");
|
||||
const mobileToolbarQuery = matchMedia("(max-width: 720px)");
|
||||
document.addEventListener("pointerdown", event => {
|
||||
if (mobileEditorOptions?.open && !event.target.closest("#mobile-editor-options")) {
|
||||
mobileEditorOptions.open = false;
|
||||
}
|
||||
if (mobileToolbarQuery.matches && markdownMore?.open && !markdownMore.contains(event.target)) {
|
||||
markdownMore.open = false;
|
||||
}
|
||||
}, { passive: true });
|
||||
document.addEventListener("keydown", event => {
|
||||
if (event.key === "Escape" && mobileEditorOptions?.open) mobileEditorOptions.open = false;
|
||||
|
||||
@@ -47,7 +47,7 @@ function safeAttachmentUrl(value) {
|
||||
: safePublicUrl(raw, { allowMailto: false });
|
||||
}
|
||||
|
||||
export function bindNoteFiles({ editor, endpoints, getAccessToken, canDelete, canUpload, toast, onFilesChanged = () => {} }) {
|
||||
export function bindNoteFiles({ editor, endpoints, getAccessToken, canDelete, canUpload, toast, onFilesChanged = () => { } }) {
|
||||
const dialog = document.querySelector("#files-dialog");
|
||||
const list = document.querySelector("#files-list");
|
||||
const input = document.querySelector("#file-input");
|
||||
|
||||
Reference in New Issue
Block a user