mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
E-book viewer: Fix modifying, then jumping to and then modifying the highlight again from the highlights panel causing the highlight to be deleted. Fixes #2033981 [E-book viewer: highlights get unexpectedly deleted](https://bugs.launchpad.net/calibre/+bug/2033981)
This commit is contained in:
parent
6c7fff344b
commit
8828bc0e61
@ -143,7 +143,6 @@ def select_crw(crw):
|
||||
sel.removeAllRanges()
|
||||
sel.addRange(r)
|
||||
return True
|
||||
else:
|
||||
print(f'range-wrapper: {crw} does not exist')
|
||||
return False
|
||||
|
||||
|
@ -877,8 +877,12 @@ class IframeBoss:
|
||||
elif dtype is 'drag-scroll':
|
||||
self.scroll_to_extend_annotation(data.backwards)
|
||||
elif dtype is 'edit-highlight':
|
||||
crw_ = {v: k for k, v in Object.entries(annot_id_uuid_map)}[data.uuid]
|
||||
if crw_ and select_crw(crw_):
|
||||
found_highlight_to_edit = False
|
||||
for qcrw, quuid in Object.entries(annot_id_uuid_map):
|
||||
if quuid is data.uuid and select_crw(qcrw):
|
||||
found_highlight_to_edit = True
|
||||
break
|
||||
if found_highlight_to_edit:
|
||||
self.ensure_selection_visible()
|
||||
window.setTimeout(def():
|
||||
self.send_message('annotations', type='edit-highlight')
|
||||
|
Loading…
x
Reference in New Issue
Block a user