Viewer: When there is empty text for an header footer section render it as blank instead of moving the remaining sections to the left

This commit is contained in:
Kovid Goyal 2019-10-04 13:12:52 +05:30
parent 25e3c0a3ba
commit b02eb9df01
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -161,6 +161,8 @@ def render_head_foot(div, which, region, progress_frac, metadata, current_toc_no
text = format_time_left(chapter_time) text = format_time_left(chapter_time)
else: else:
text = '{} ({})'.format(format_time_left(chapter_time), format_time_left(book_time)) text = '{} ({})'.format(format_time_left(chapter_time), format_time_left(book_time))
if not text:
text = '\xa0'
if text is not div.textContent: if text is not div.textContent:
div.textContent = text div.textContent = text
div.style.display = 'block' if text else 'none' div.style.display = 'block' if text else 'none'