mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-07 10:14:46 -04:00
Do not update toc anchor map repeatedly
This commit is contained in:
parent
6fffa70b2a
commit
d276e5be45
@ -30,7 +30,8 @@ from read_book.flow_mode import (
|
||||
from read_book.footnotes import is_footnote_link
|
||||
from read_book.globals import (
|
||||
annot_id_uuid_map, clear_annot_id_uuid_map, current_book, current_layout_mode,
|
||||
current_spine_item, runtime, set_boss, set_current_spine_item, set_layout_mode
|
||||
current_spine_item, runtime, set_boss, set_current_spine_item, set_layout_mode,
|
||||
set_toc_anchor_map
|
||||
)
|
||||
from read_book.mathjax import apply_mathjax
|
||||
from read_book.paged_mode import (
|
||||
@ -202,6 +203,7 @@ class IframeBoss:
|
||||
self.content_ready = False
|
||||
clear_annot_id_uuid_map()
|
||||
reset_highlight_counter()
|
||||
set_toc_anchor_map()
|
||||
self.replace_history_on_next_cfi_update = True
|
||||
self.book = current_book.book = data.book
|
||||
self.reference_mode_enabled = data.reference_mode_enabled
|
||||
|
@ -181,7 +181,7 @@ def current_toc_anchor_map(tam, anchor_funcs):
|
||||
# stable sort by position in document
|
||||
anchors.sort(def (a, b): return anchor_funcs.cmp(am[a], am[b]) or (pos_map[a] - pos_map[b]);)
|
||||
|
||||
current_map = {'layout_mode': current_layout_mode, 'width': scroll_viewport.width(), 'height': scroll_viewport.height(), 'pos_map': am, 'sorted_anchors':anchors}
|
||||
current_map = {'layout_mode': current_layout_mode(), 'width': scroll_viewport.width(), 'height': scroll_viewport.height(), 'pos_map': am, 'sorted_anchors':anchors}
|
||||
set_toc_anchor_map(current_map)
|
||||
return current_map
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user