swiped-events icon indicating copy to clipboard operation
swiped-events copied to clipboard

Extract swiped events addition function, so iframe can use it.

Open MrMYHuang opened this issue 5 years ago • 0 comments

The original swiped-events.js runs the swiped events addition function with main window and document of browser after require. However, this limits the use of this script: how do we webpack swiped-events.js for an iframe?

Thus, I extract the swiped events addition function from swiped-events.js into another file, add.js. swiped-events.js require and run it without breaking programs after updating to this swiped-events version.

This app is a demo using the modified swiped-events in an iframe: https://mrmyhuang.github.io/catalog/juan/T0001/1 Try to use right or left swipe to move to next or previous page. Its source code shows the use: https://github.com/MrMYHuang/cbetar2/blob/9aa742ec58ab9bcb453668552840f9bf0a01a455/src/pages/EPubViewPage.tsx#L32-L34

MrMYHuang avatar Dec 06 '20 08:12 MrMYHuang