Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow loading as ES6 module #11

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Conversation

letorbi
Copy link

@letorbi letorbi commented May 8, 2023

This PR allows to load the code as an ES6 module, by adding the main function TouchMenuLA explicitly to the window object. This should not change any behavior and cause no unwanted side-effects.

Apart from that the main value in package.json has been set to the minimized script to avoid the need to specify the full path to the JS file.

Once the PR is merged, the the JS code for the touch menu can be loaded as follows:

import { } from "hammerjs";
import { } from "touch-menu-la";

The CSS still needs to be loaded as before.

I've just ported an app for hangboard training from Cordova to Capacitor, which required this little change to make it work again, and thought that it might be helpful for others as well...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant