Version 2.0!
This commit is contained in:
11
src/action.js
Normal file
11
src/action.js
Normal file
@@ -0,0 +1,11 @@
|
||||
export function bindActionHandler(element, options={}) {
|
||||
customElements.whenDefined("long-press").then(() => {
|
||||
const longpress = document.body.querySelector("long-press");
|
||||
longpress.bind(element);
|
||||
});
|
||||
customElements.whenDefined("action-handler").then(() => {
|
||||
const actionHandler = document.body.querySelector("action-handler");
|
||||
actionHandler.bind(element, options);
|
||||
});
|
||||
return element;
|
||||
}
|
||||
Reference in New Issue
Block a user