mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-07 18:24:30 -04:00
Viewer: Fix a regression that broke searching in flow mode. Fixes #1874877 [In the viewer search when a value is found receive and Uncaught RangerError](https://bugs.launchpad.net/calibre/+bug/1874877)
This commit is contained in:
parent
d276e5be45
commit
67ed07db66
@ -222,6 +222,7 @@ class IframeBoss:
|
|||||||
self.anchor_funcs = flow_anchor_funcs
|
self.anchor_funcs = flow_anchor_funcs
|
||||||
self.auto_scroll_action = flow_auto_scroll_action
|
self.auto_scroll_action = flow_auto_scroll_action
|
||||||
self.scroll_to_extend_annotation = flow_annotation_scroll
|
self.scroll_to_extend_annotation = flow_annotation_scroll
|
||||||
|
self.ensure_selection_visible = ensure_selection_visible
|
||||||
paged_auto_scroll_action('stop')
|
paged_auto_scroll_action('stop')
|
||||||
else:
|
else:
|
||||||
self.do_layout = paged_layout
|
self.do_layout = paged_layout
|
||||||
@ -233,6 +234,7 @@ class IframeBoss:
|
|||||||
self.anchor_funcs = paged_anchor_funcs
|
self.anchor_funcs = paged_anchor_funcs
|
||||||
self.auto_scroll_action = paged_auto_scroll_action
|
self.auto_scroll_action = paged_auto_scroll_action
|
||||||
self.scroll_to_extend_annotation = paged_annotation_scroll
|
self.scroll_to_extend_annotation = paged_annotation_scroll
|
||||||
|
self.ensure_selection_visible = snap_to_selection
|
||||||
flow_auto_scroll_action('stop')
|
flow_auto_scroll_action('stop')
|
||||||
update_settings(data.settings)
|
update_settings(data.settings)
|
||||||
self.keyboard_shortcut_map = create_shortcut_map(data.settings.keyboard_shortcuts)
|
self.keyboard_shortcut_map = create_shortcut_map(data.settings.keyboard_shortcuts)
|
||||||
@ -620,12 +622,6 @@ class IframeBoss:
|
|||||||
if refnum?:
|
if refnum?:
|
||||||
self.scroll_to_ref(refnum)
|
self.scroll_to_ref(refnum)
|
||||||
|
|
||||||
def ensure_selection_visible(self):
|
|
||||||
if current_layout_mode() is 'flow':
|
|
||||||
ensure_selection_visible()
|
|
||||||
else:
|
|
||||||
snap_to_selection()
|
|
||||||
|
|
||||||
def find(self, data, from_load):
|
def find(self, data, from_load):
|
||||||
if data.searched_in_spine:
|
if data.searched_in_spine:
|
||||||
window.getSelection().removeAllRanges()
|
window.getSelection().removeAllRanges()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user