diff --git a/src/pyj/dom.pyj b/src/pyj/dom.pyj index a4d80bff63..f88ba5da3c 100644 --- a/src/pyj/dom.pyj +++ b/src/pyj/dom.pyj @@ -42,6 +42,7 @@ def set_css(elem, **kw): s.removeProperty('-' + prefix + '-' + name) else: s.setProperty('-' + prefix + '-' + name, val) + return elem def build_rule(selector, **kw): ans = v'[selector + " { "]' diff --git a/src/pyj/read_book/overlay.pyj b/src/pyj/read_book/overlay.pyj index 18c69fc1c7..169afcd475 100644 --- a/src/pyj/read_book/overlay.pyj +++ b/src/pyj/read_book/overlay.pyj @@ -40,16 +40,13 @@ class MainOverlay: # {{{ def show(self, container): self.container_id = container.getAttribute('id') - top_row = E.div( - E.div( + container.appendChild(set_css(E.div( + set_css(E.div( + onclick=def (evt):evt.stopPropagation();, E.div(self.overlay.view.book.metadata.title, style='max-width: 90%; text-overflow: ellipsis'), E.div(self.date_formatter.format(Date()), style='max-width: 9%; text-overflow: ellipsis'), - onclick=def (evt):evt.stopPropagation();, - style='font-size: smaller; padding: 0.5ex 1rem; border-bottom: solid 1px currentColor' - ) - ) - set_css(top_row.firstChild, background_color=get_color('window-background'), display='flex', justify_content='space-between', align_items='baseline') - container.appendChild(top_row) + ), display='flex', justify_content='space-between', align_items='baseline', font_size='smaller', padding='0.5ex 1rem', border_bottom='solid 1px currentColor') + ), background_color=get_color('window-background'))) self.timer = setInterval(self.update_time, 1000) def update_time(self):