UNPKG

react-klasha

Version:

This is an reactJS library for implementing klasha payment gateway

25 lines (22 loc) 709 B
import { f as readTask, c as writeTask } from './index-7a8b7a1c.js'; import { c as componentOnReady } from './helpers-dd7e4b7b.js'; const startStatusTap = () => { const win = window; win.addEventListener('statusTap', () => { readTask(() => { const width = win.innerWidth; const height = win.innerHeight; const el = document.elementFromPoint(width / 2, height / 2); if (!el) { return; } const contentEl = el.closest('ion-content'); if (contentEl) { new Promise(resolve => componentOnReady(contentEl, resolve)).then(() => { writeTask(() => contentEl.scrollToTop(300)); }); } }); }); }; export { startStatusTap };