From a7f510783d5a757afc35bb834c60ca3217375d5d Mon Sep 17 00:00:00 2001 From: zadam Date: Mon, 5 Oct 2020 21:31:57 +0200 Subject: [PATCH] reduce top margin of first paragraph in text, closes #1286 --- src/public/app/widgets/type_widgets/editable_text.js | 8 ++++---- src/services/note_cache/note_cache_service.js | 4 ++++ 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/public/app/widgets/type_widgets/editable_text.js b/src/public/app/widgets/type_widgets/editable_text.js index c79590ebb..ca7309c87 100644 --- a/src/public/app/widgets/type_widgets/editable_text.js +++ b/src/public/app/widgets/type_widgets/editable_text.js @@ -38,6 +38,10 @@ const TPL = ` cursor: text !important; } + .note-detail-editable-text *:first-child { + margin-top: 0 !important; + } + .note-detail-editable-text h1 { font-size: 2.0em; } .note-detail-editable-text h2 { font-size: 1.8em; } .note-detail-editable-text h3 { font-size: 1.6em; } @@ -59,10 +63,6 @@ const TPL = ` /* This is because with empty content height of editor is 0 and it's impossible to click into it */ min-height: 500px; } - - .note-detail-editable-text p:first-child, .note-detail-editable-text::before { - margin-top: 0; - }
diff --git a/src/services/note_cache/note_cache_service.js b/src/services/note_cache/note_cache_service.js index 98c6b3f7c..2471afbca 100644 --- a/src/services/note_cache/note_cache_service.js +++ b/src/services/note_cache/note_cache_service.js @@ -49,6 +49,10 @@ function isInAncestor(noteId, ancestorNoteId) { const note = noteCache.notes[noteId]; + if (!note) { + return false; + } + for (const parentNote of note.parents) { if (isInAncestor(parentNote.noteId, ancestorNoteId)) { return true;