Show communities spinner (in Napili) via custom lightning component

When you change pages in the Napili template, there’s a spinner that displays. It’s a white rectangular box with three animated dots. Is there an event I can fire through a lightning component that will display that spinner, or some other way of displaying the spinner?

Note: looking through the auradocs documentation doesn’t seem to indicate there is a standard event for displaying the spinner.
enter image description here

Answer

You can do this by running your own JavaScript function (from within the controller / helper of a component) when you wish to trigger the event.

To show the spinner, you can use:
document.querySelector('.siteforceSpinnerManager.siteforcePanelsContainer').classList.remove('hideEl')

and to hide it again, you can use:
document.querySelector('.siteforceSpinnerManager.siteforcePanelsContainer').classList.add('hideEl')

Attribution
Source : Link , Question Author : James Loghry , Answer Author : Chirag Bhatia – chirag64

Leave a Comment