From 3a4bcfc06e92f9c9f66f2cf285ffd296a77ca462 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Fri, 24 Jul 2020 16:28:17 +0530 Subject: [PATCH] Hide buttons when showing middle --- src/pyj/read_book/create_annotation.pyj | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/pyj/read_book/create_annotation.pyj b/src/pyj/read_book/create_annotation.pyj index aa89526417..ae7d492cfa 100644 --- a/src/pyj/read_book/create_annotation.pyj +++ b/src/pyj/read_book/create_annotation.pyj @@ -21,6 +21,7 @@ # Google lookup for selections # Export all annots as plain text/JSON # Remove lookup and create highlight buttons from chrome +# Fix selection bar remaining open after removing highlight class AnnotationsManager: @@ -355,6 +356,7 @@ def button(name, bar, icon, tt, action): cb.style.marginLeft = '0.5rem' cb.style.marginRight = '0.5rem' cb.classList.add('simple-link') + cb.classList.add('adjust-button') cb.classList.add(f'button-{name}') cb.addEventListener('click', def(ev): ev.preventDefault(), ev.stopPropagation() @@ -448,6 +450,8 @@ def show_middle(self, pre_close_callback): self.pre_middle_close_callback = pre_close_callback self.temporarily_hide_handles() self.middle.style.display = 'block' + for button in self.container.querySelectorAll('.adjust-button'): + button.style.visibility = 'hidden' def hide_middle(self): m = self.middle @@ -457,6 +461,8 @@ def hide_middle(self): return self.pre_middle_close_callback = None self.unhide_handles() + for button in self.container.querySelectorAll('.adjust-button'): + button.style.visibility = 'unset' m.style.display = 'none' self.container.focus()