Reset a couple more globals on flow change

This commit is contained in:
Kovid Goyal 2017-02-23 23:43:57 +05:30
parent 8867ca68fc
commit e79cb5ba79
2 changed files with 4 additions and 2 deletions

View File

@ -109,6 +109,7 @@ class IframeBoss:
def display(self, data):
self.content_ready = False
self.replace_history_on_next_cfi_update = True
self.book = current_book.book = data.book
spine = self.book.manifest.spine
index = spine.indexOf(data.name)

View File

@ -51,11 +51,13 @@ def in_paged_mode():
return _in_paged_mode
col_width = screen_width = screen_height = cols_per_screen = gap = col_and_gap = 0
is_full_screen_layout = False
current_scroll_animation = None
def reset_paged_mode_globals():
nonlocal _in_paged_mode, col_width, col_and_gap, screen_height, gap, screen_width, is_full_screen_layout, cols_per_screen
nonlocal _in_paged_mode, col_width, col_and_gap, screen_height, gap, screen_width, is_full_screen_layout, cols_per_screen, current_scroll_animation
col_width = screen_width = screen_height = cols_per_screen = gap = col_and_gap = 0
is_full_screen_layout = _in_paged_mode = False
current_scroll_animation = None
def column_at(xpos):
# Return the (zero-based) number of the column that contains xpos
@ -247,7 +249,6 @@ def scroll_to_fraction(frac):
xpos = Math.floor(document.body.scrollWidth * frac)
scroll_to_xpos(xpos)
current_scroll_animation = None
def animated_scroll(pos, duration=1000, notify=True):
# Scroll the window to X-position pos in an animated fashion over