From ded52279fcd1762080db6a0e79a1bae1c4158213 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Wed, 24 Jun 2020 15:06:22 +0530 Subject: [PATCH] Fix existing notes not being prefilled when editing an annotation --- src/pyj/read_book/create_annotation.pyj | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/pyj/read_book/create_annotation.pyj b/src/pyj/read_book/create_annotation.pyj index 5049c53fca..0f3a67286c 100644 --- a/src/pyj/read_book/create_annotation.pyj +++ b/src/pyj/read_book/create_annotation.pyj @@ -271,6 +271,9 @@ class CreateAnnotation: return document.getElementById(self.middle_id) def add_notes(self): + current_notes = self.current_notes + if not current_notes and self.editing_annot_uuid: + current_notes = self.annotations_manager.notes_for_highlight(self.editing_annot_uuid) self.show_middle(self.apply_notes) container = self.middle clear(container) @@ -283,7 +286,7 @@ class CreateAnnotation: E.h3(_('Add notes for this highlight')), E.textarea( - self.current_notes or '', + current_notes or '', rows='10', spellcheck='true', style='resize: none; width: 80vw; max-width: 80em; margin: 1ex', onkeydown=def(ev): ev.stopPropagation()