You could have a function in SearchFiltersPanel which takes a String ('layers' in this case) and returns the HTML for the spinner. That way you don't have the spinner HTML in the en.js file but you also don't have to duplicate the HTML out here is code.