mirror of https://github.com/ghostfolio/ghostfolio
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
39 lines
1.5 KiB
39 lines
1.5 KiB
/*!
|
|
* (C) Ionic http://ionicframework.com - MIT License
|
|
*/
|
|
import { readTask, writeTask } from '@stencil/core/internal/client';
|
|
import { a as findClosestIonContent, s as scrollToTop } from './index8.js';
|
|
import { c as componentOnReady } from './helpers.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 = findClosestIonContent(el);
|
|
if (contentEl) {
|
|
new Promise((resolve) => componentOnReady(contentEl, resolve)).then(() => {
|
|
writeTask(async () => {
|
|
/**
|
|
* If scrolling and user taps status bar,
|
|
* only calling scrollToTop is not enough
|
|
* as engines like WebKit will jump the
|
|
* scroll position back down and complete
|
|
* any in-progress momentum scrolling.
|
|
*/
|
|
contentEl.style.setProperty('--overflow', 'hidden');
|
|
await scrollToTop(contentEl, 300);
|
|
contentEl.style.removeProperty('--overflow');
|
|
});
|
|
});
|
|
}
|
|
});
|
|
});
|
|
};
|
|
|
|
export { startStatusTap };
|
|
|