mirror of
git://github.com/kovidgoyal/calibre.git
synced 2026-05-05 04:43:41 +02:00
Handle Chrome changing window level touch even handlers to passive by default in newer releases
This commit is contained in:
parent
5b2f202a2c
commit
5b3d7c04cf
1 changed files with 5 additions and 4 deletions
|
|
@ -267,10 +267,11 @@ def __repr__(self):
|
|||
right_margin_handler = BookTouchHandler('right')
|
||||
|
||||
def install_handlers(elem, handler):
|
||||
elem.addEventListener('touchstart', handler.handle_touchstart, True)
|
||||
elem.addEventListener('touchmove', handler.handle_touchmove, True)
|
||||
elem.addEventListener('touchend', handler.handle_touchend, True)
|
||||
elem.addEventListener('touchcancel', handler.handle_touchcancel, True)
|
||||
options = {'capture': True, 'passive': False}
|
||||
elem.addEventListener('touchstart', handler.handle_touchstart, options)
|
||||
elem.addEventListener('touchmove', handler.handle_touchmove, options)
|
||||
elem.addEventListener('touchend', handler.handle_touchend, options)
|
||||
elem.addEventListener('touchcancel', handler.handle_touchcancel, options)
|
||||
|
||||
def create_handlers():
|
||||
install_handlers(window, main_touch_handler)
|
||||
|
|
|
|||
Loading…
Reference in a new issue