From 902c0b910ee7bc80ea6f93796adc91579814081b Mon Sep 17 00:00:00 2001 From: BrokenEagle Date: Sat, 28 Mar 2020 19:08:51 +0000 Subject: [PATCH 1/3] Make note bodies smaller and simpler for embedded notes --- app/javascript/src/javascripts/notes.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/app/javascript/src/javascripts/notes.js b/app/javascript/src/javascripts/notes.js index 4da264995..45d08c3be 100644 --- a/app/javascript/src/javascripts/notes.js +++ b/app/javascript/src/javascripts/notes.js @@ -527,7 +527,6 @@ let Note = { }, set_text: function($note_body, $note_box, text) { - Note.Body.display_text($note_body, text); if (Note.embed) { const $note_inner_box = $note_box.find("div.note-box-inner-border"); Note.Body.display_text($note_inner_box, text); @@ -537,6 +536,8 @@ let Note = { // Clear the font size so that the fonts will be scaled to the current value $note_inner_box.css("font-size", ""); Note.Box.copy_style_attributes($note_box); + } else { + Note.Body.display_text($note_body, text); } Note.Body.resize($note_body); Note.Body.bound_position($note_body); @@ -948,9 +949,11 @@ let Note = { container.appendChild($note_body[0]); $note_body.data("original-body", original_body); Note.Box.scale($note_box); - Note.Body.display_text($note_body, sanitized_body); if (Note.embed) { Note.Body.display_text($note_box.children("div.note-box-inner-border"), sanitized_body); + Note.Body.display_text($note_body, "Click to edit."); + } else { + Note.Body.display_text($note_body, sanitized_body); } }, From 73584521526e9084b88ba820d27e9c16783155fb Mon Sep 17 00:00:00 2001 From: BrokenEagle Date: Sat, 28 Mar 2020 20:54:12 +0000 Subject: [PATCH 2/3] Fix note borders not showing up with the dark theme - Also remove unnecessary duplicated note variables for dark theme --- app/javascript/src/styles/base/040_colors.css | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/app/javascript/src/styles/base/040_colors.css b/app/javascript/src/styles/base/040_colors.css index beef5495a..284e19e30 100644 --- a/app/javascript/src/styles/base/040_colors.css +++ b/app/javascript/src/styles/base/040_colors.css @@ -343,17 +343,11 @@ body[data-current-user-theme="dark"] { --news-updates-background: var(--grey-3); --news-updates-border: 2px solid var(--grey-4); - --note-body-background: #FFE; --note-body-text-color: var(--grey-1); - --note-body-border: 1px solid black; - --note-box-border: 1px solid white; - --note-box-background: transparent; - --note-box-inner-border: 1px solid black; - --unsaved-note-box-inner-border: 1px solid var(--red-1); + --unsaved-note-box-border: 1px solid var(--red-1); + --movable-note-box-border: 1px solid var(--green-1); --note-preview-border: 1px solid var(--red-1); - --note-preview-background: white; --note-highlight-color: var(--blue-1); - --note-tn-color: var(--muted-text-color); --notice-error-background: var(--red-0); --notice-error-border: 1px solid var(--grey-4); From ddb888297ea8c12a6847b35188780bd29a2e3393 Mon Sep 17 00:00:00 2001 From: BrokenEagle Date: Sat, 28 Mar 2020 21:04:53 +0000 Subject: [PATCH 3/3] Fix movable status not being removed after the note has been saved This was also causing the movable status on new notes to require clicking twice to remove that status since the note ID gets changed but the move ID wasn't. --- app/javascript/src/javascripts/notes.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/javascript/src/javascripts/notes.js b/app/javascript/src/javascripts/notes.js index 45d08c3be..3a937b093 100644 --- a/app/javascript/src/javascripts/notes.js +++ b/app/javascript/src/javascripts/notes.js @@ -680,10 +680,13 @@ let Note = { $note_body.data("id", String(data.id)).attr("data-id", data.id); $note_box.data("id", String(data.id)).attr("data-id", data.id); $note_box.removeClass("unsaved"); + $note_box.removeClass("movable"); } else { $note_box = Note.Box.find(data.id); $note_box.removeClass("unsaved"); + $note_box.removeClass("movable"); } + Note.move_id = null; }, save: function() {