Files
breadcrumb-the-shire/web/js/core/app-fslightbox-bridge.js

22 lines
492 B
JavaScript
Raw Normal View History

/**
* Shared bridge for scheduling fsLightbox refresh calls without global window APIs.
*/
let refreshPending = false;
export const requestFsLightboxRefresh = () => {
if (typeof window.refreshFsLightbox === 'function') {
window.refreshFsLightbox();
refreshPending = false;
return true;
}
refreshPending = true;
return false;
};
export const flushPendingFsLightboxRefresh = () => {
if (!refreshPending) {
return false;
}
return requestFsLightboxRefresh();
};