From c379616be03cd84b860572a0d36ed96c65dee1c0 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Mon, 23 Oct 2023 08:43:00 +0530 Subject: [PATCH] Clean up modal formatting --- src/pyj/book_list/router.pyj | 14 +------------- src/pyj/book_list/search.pyj | 8 ++++---- src/pyj/modals.pyj | 2 +- 3 files changed, 6 insertions(+), 18 deletions(-) diff --git a/src/pyj/book_list/router.pyj b/src/pyj/book_list/router.pyj index a33cce8db5..4971b622af 100644 --- a/src/pyj/book_list/router.pyj +++ b/src/pyj/book_list/router.pyj @@ -87,21 +87,9 @@ def open_book_url(book_id, fmt, extra_query): return ans + encode_query(q, '#') -def show_note_url(book_id, field, item_id, item_value, library_id=None, close_action='back'): - lid = library_id or current_library_id() - ans = absolute_path('') - q = { - 'book_id':book_id + '', 'field': field, 'item':item_value + '', - 'item_id': item_id + '', 'panel': 'show_note', 'close_action': close_action - } - if lid: - q.library_id = lid - return ans + encode_query(q, '#') - - def show_note(book_id, field, item_id, item_value, replace=False, library_id=None, close_action='back', panel='show_note'): lid = library_id or current_library_id() - q = {'book_id':book_id + '', 'field': field, 'item':item_value + '', 'item_id': item_id + '', 'panel': panel} + q = {'book_id':book_id + '', 'field': field, 'item':item_value + '', 'item_id': (item_id or '')+ '', 'panel': panel} if panel is 'show_note': q.close_action = close_action if lid: diff --git a/src/pyj/book_list/search.pyj b/src/pyj/book_list/search.pyj index fff1b42c5c..7f243e38eb 100644 --- a/src/pyj/book_list/search.pyj +++ b/src/pyj/book_list/search.pyj @@ -233,8 +233,8 @@ def menu_clicked(i): title = E.h2( style='display:flex; align-items: center; border-bottom: solid 1px currentColor; font-weight:bold; font-size:' + get_font_size('title'), - E.img(src=icon_for_node(node), style='height:2ex'), - E.span('\xa0' + name + suffix) + E.img(src=icon_for_node(node), style='height:2ex; margin-right: 0.5rem'), + E.span(name + suffix) ) container.appendChild(title) container.appendChild(E.div( @@ -257,8 +257,8 @@ def menu_clicked(i): for text, search_type in items: li = E.li( style='display:flex; align-items: center; margin-bottom:0.5ex; padding: 0.5ex; cursor:pointer', - E.img(src=absolute_path('{}/{}.png'.format(interface_data.icon_path, search_type)), style='max-height: 2.5ex'), - E.span('\xa0' + text) + E.img(src=absolute_path('{}/{}.png'.format(interface_data.icon_path, search_type)), style='max-height: 2.5ex; margin-right:0.5rem'), + E.span(text) ) li.addEventListener('click', add_to_search.bind(None, node, search_type)) li.addEventListener('click', hide_modal) diff --git a/src/pyj/modals.pyj b/src/pyj/modals.pyj index ef0e0fa004..6f9f80e1ec 100644 --- a/src/pyj/modals.pyj +++ b/src/pyj/modals.pyj @@ -55,7 +55,7 @@ class ModalContainer: set_css(div, position='fixed', top='0', right='0', bottom='0', left='0', # Stretch over entire window background_color='rgba(0,0,0,0.8)', z_index=MODAL_Z_INDEX + '', - display='none', text_align='center', user_select='none' + display='none', user_select='none' ) # Popup style