mirror of
https://github.com/zadam/trilium.git
synced 2024-09-21 08:06:03 +08:00
fix context submenus, closes #810
This commit is contained in:
parent
24c5388e0c
commit
ccaa9eae3a
|
@ -76,8 +76,7 @@ async function initContextMenu(event, contextMenu) {
|
||||||
// in such case we'll position it above click coordinates so it will fit into client
|
// in such case we'll position it above click coordinates so it will fit into client
|
||||||
const clickPosition = event.pageY;
|
const clickPosition = event.pageY;
|
||||||
const clientHeight = document.documentElement.clientHeight;
|
const clientHeight = document.documentElement.clientHeight;
|
||||||
const contextMenuHeight = $contextMenuContainer.height();
|
const contextMenuHeight = $contextMenuContainer.outerHeight() + 30;
|
||||||
|
|
||||||
let top;
|
let top;
|
||||||
|
|
||||||
if (clickPosition + contextMenuHeight > clientHeight) {
|
if (clickPosition + contextMenuHeight > clientHeight) {
|
||||||
|
|
|
@ -110,7 +110,7 @@ body {
|
||||||
|
|
||||||
#context-menu-container {
|
#context-menu-container {
|
||||||
max-height: 100vh;
|
max-height: 100vh;
|
||||||
overflow: auto; /* make it scrollable when exceeding total height of the window */
|
/* !!! Cannot set overflow: auto, submenus will break !!! */
|
||||||
}
|
}
|
||||||
|
|
||||||
#context-menu-container, #context-menu-container .dropdown-menu {
|
#context-menu-container, #context-menu-container .dropdown-menu {
|
||||||
|
|
|
@ -490,6 +490,8 @@ async function eraseDeletedNotes() {
|
||||||
SET isErased = 1,
|
SET isErased = 1,
|
||||||
title = NULL
|
title = NULL
|
||||||
WHERE isErased = 0 AND noteId IN (???)`, noteIdsToErase);
|
WHERE isErased = 0 AND noteId IN (???)`, noteIdsToErase);
|
||||||
|
|
||||||
|
log.info(`Erased notes: ${JSON.stringify(noteIdsToErase)}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
async function duplicateNote(noteId, parentNoteId) {
|
async function duplicateNote(noteId, parentNoteId) {
|
||||||
|
|
Loading…
Reference in a new issue