From 5b3d7c04cf36e37d5172e713a5973607a228e42e Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Thu, 11 May 2017 16:30:34 +0530 Subject: [PATCH] Handle Chrome changing window level touch even handlers to passive by default in newer releases --- src/pyj/read_book/touch.pyj | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/pyj/read_book/touch.pyj b/src/pyj/read_book/touch.pyj index 73bfc6f0c0..8ba54ed32c 100644 --- a/src/pyj/read_book/touch.pyj +++ b/src/pyj/read_book/touch.pyj @@ -267,10 +267,11 @@ left_margin_handler = BookTouchHandler('left') 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)