readium / readium-js-viewer

👁 ReadiumJS viewer: default web app for Readium.js library
BSD 3-Clause "New" or "Revised" License
553 stars 186 forks source link

Migrate touch / gesture Hammer library to v2 API #221

Open danielweck opened 10 years ago

danielweck commented 10 years ago

Current version is 1.x https://github.com/readium/readium-js-viewer/blob/develop/lib/thirdparty/hammer.js

Version 2.x has a new API: http://hammerjs.github.io/changelog/

What's new in 2.0?
It's completely rewritten, with reusable gesture recognisers,
and improved support for the recent mobile browsers
by making use of the touch-action css property when possible.
Also support for multiple Hammer instances the same time,
so multi-user became possible.

Useful pointer: http://tech.gilt.com/post/98240068394/five-things-you-need-to-know-about-hammer-js-2-0

Code to migrate: https://github.com/readium/readium-js-viewer/blob/develop/lib/gestures.js

danielweck commented 8 years ago

Swipe gestures currently disabled in ReadiumJS: https://github.com/readium/readium-js-viewer/blob/develop/src/js/gestures.js#L18

danielolivaresd commented 8 years ago

Hi @danielweck ,

I think I've managed to add swipe handling for Hammer v2 API. I´ve made a PR at https://github.com/readium/readium-js-viewer/pull/479

It seems to be working fine. Let me know if there's something missing.