import PullToRefresh from "pulltorefreshjs"; const SEARCH_ICON = ``; export default function initPullToSearch() { PullToRefresh.init({ mainElement: "body", triggerElement: "body", instructionsPullToRefresh: " ", instructionsReleaseToRefresh: " ", instructionsRefreshing: " ", iconArrow: SEARCH_ICON, iconRefreshing: SEARCH_ICON, distThreshold: 60, distMax: 80, distReload: 50, shouldPullToRefresh() { return !window.scrollY; }, onRefresh() { const btn = document.getElementById("universal-search-button"); if (btn) btn.click(); }, }); }