UNPKG

@ekx/auph

Version:

[![Build](https://github.com/eliasku/auph/actions/workflows/build.yml/badge.svg)](https://github.com/eliasku/auph/actions/workflows/build.yml) [![Version](https://img.shields.io/npm/v/auph)](https://www.npmjs.com/package/auph) [![Downloads](https://img.sh

18 lines 587 B
import { len } from "./common"; export function unlock(unlocked) { // "touchstart", "touchend", "mousedown", "pointerdown" var events = ["touchstart", "touchend", "mousedown", "click", "keydown"]; var num = len(events); var doc = document; var handle = function () { if (unlocked()) { for (var i = 0; i < num; ++i) { doc.removeEventListener(events[i], handle, true); } } }; for (var i = 0; i < num; ++i) { doc.addEventListener(events[i], handle, true); } } //# sourceMappingURL=Unlock.js.map