UNPKG

@ministryofjustice/hmpps-digital-prison-reporting-frontend

Version:

The Digital Prison Reporting Frontend contains templates and code to help display data effectively in UI applications.

24 lines (21 loc) 718 B
export default class DprLoadingHelper { showLoadingAnimation(wrapperClass) { const loadingPanelClass = '.dpr-loading-panel' document.querySelectorAll(loadingPanelClass).forEach((l) => { l.classList.add('show') }) let loadingAnimClass = '.dpr-loading-anim' if (wrapperClass) loadingAnimClass = `.${wrapperClass} ${loadingAnimClass}` document.querySelectorAll(loadingAnimClass).forEach((l) => { l.classList.add('show') }) } hideLoadingAnimation() { document.querySelectorAll('.dpr-loading-panel').forEach((l) => { l.classList.remove('show') }) document.querySelectorAll('.dpr-loading-anim').forEach((l) => { l.classList.remove('show') }) } }