mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Avoid unnecessary selection change events
This commit is contained in:
parent
3d685b46b9
commit
9b79b12239
@ -186,6 +186,8 @@ def move_end_of_selection(pos, start):
|
|||||||
if p:
|
if p:
|
||||||
r = sel.getRangeAt(0)
|
r = sel.getRangeAt(0)
|
||||||
if start:
|
if start:
|
||||||
|
if r.startContainer is not p.offsetNode or r.startOffset is not p.offset:
|
||||||
r.setStart(p.offsetNode, p.offset)
|
r.setStart(p.offsetNode, p.offset)
|
||||||
else:
|
else:
|
||||||
|
if r.endContainer is not p.offsetNode or r.endOffset is not p.offset:
|
||||||
r.setEnd(p.offsetNode, p.offset)
|
r.setEnd(p.offsetNode, p.offset)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user