Skip to content

avrahamcool/aurelia-long-click-event

Repository files navigation

aurelia-long-click-event

aurelia plugin for long-click event.

License: MIT Issues

NPMVersion NPMDownloads NPMSize

Total alerts Language grade: JavaScript DeepScan grade

How to Use

install the plugin using yarn or npm.

yarn add aurelia-long-click-event
npm install aurelia-long-click-event

initialize the plugin in your main.js or main.ts.

  import { PLATFORM } from "aurelia-pal";

  aurelia.use
    .standardConfiguration()
    .developmentLogging()
+    .plugin(PLATFORM.moduleName("aurelia-long-click-event"));

you can pass optional configuration to control the name of the long-click event (defaults to "long-click"), and the click duration (defaults to 500 ms).

  import { LongClickConfig } from "aurelia-long-click-event"; // (TS users can use this interface for strongly typed config)
    ...
    .plugin(PLATFORM.moduleName("aurelia-long-click-event"), { longClickEventName: "long-click", clickDurationMS: 500 });

now you can register callbacks to the event just like any regular event (using trigger or delegate)

<button long-click.delegate="longClick()">long click me</button>

plugin was build using:

How to build and run sample

  • npm run watch

    • Launches sample and watches src folder
    • it does the type-checking and ts-lints on every save
    • open http://localhost:4444 to see the plugin in action.
  • npm run build

    • Produces amd/commonjs/system/es2015 builds
    • This will NOT emit/update files if you have any typescript or tslint errors

I Need help regarding how to test the plugin - PR welcome

About

aurelia plugin for long-click event

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published