Remove unused code

This commit is contained in:
Kovid Goyal 2019-11-10 21:32:29 +05:30
parent 52750191f1
commit b1dbedaab0
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C
2 changed files with 4 additions and 12 deletions

View File

@ -190,4 +190,4 @@ def render_head_foot(div, which, region, metadata, current_toc_node, current_toc
if text is not div.textContent: if text is not div.textContent:
div.textContent = text div.textContent = text
div.style.display = 'block' div.style.display = 'block'
return text, has_clock return has_clock

View File

@ -884,18 +884,10 @@ class View:
nonlocal has_clock nonlocal has_clock
if sd.get(sz_attr, 20) > 5: if sd.get(sz_attr, 20) > 5:
mi = self.book.metadata mi = self.book.metadata
texta, hca = render_head_foot(div.firstChild, name, 'left', mi, self.current_toc_node, self.current_toc_toplevel_node, book_time, chapter_time, pos) hca = render_head_foot(div.firstChild, name, 'left', mi, self.current_toc_node, self.current_toc_toplevel_node, book_time, chapter_time, pos)
textb, hcb = render_head_foot(div.firstChild.nextSibling, name, 'middle', mi, self.current_toc_node, self.current_toc_toplevel_node, book_time, chapter_time, pos) hcb = render_head_foot(div.firstChild.nextSibling, name, 'middle', mi, self.current_toc_node, self.current_toc_toplevel_node, book_time, chapter_time, pos)
textc, hcc = render_head_foot(div.lastChild, name, 'right', mi, self.current_toc_node, self.current_toc_toplevel_node, book_time, chapter_time, pos) hcc = render_head_foot(div.lastChild, name, 'right', mi, self.current_toc_node, self.current_toc_toplevel_node, book_time, chapter_time, pos)
has_clock = hca or hcb or hcc has_clock = hca or hcb or hcc
if textc and not textb and not texta:
# Want right-aligned
div.firstChild.style.display = 'block'
div.firstChild.nextSibling.style.display = 'block'
elif not texta and not textc and textb:
# Want centered
div.firstChild.style.display = 'block'
div.lastChild.style.display = 'block'
else: else:
for c in div.childNodes: for c in div.childNodes:
c.style.display = 'none' c.style.display = 'none'