2021-04-12 08:26:22 +02:00
|
|
|
import { htmlHelper } from "discourse-common/lib/helpers";
|
2017-10-09 07:52:09 +02:00
|
|
|
|
|
|
|
function renderSpinner(cssClass) {
|
|
|
|
var html = "<div class='spinner";
|
2021-04-12 08:26:22 +02:00
|
|
|
if (cssClass) {
|
|
|
|
html += " " + cssClass;
|
|
|
|
}
|
2017-10-09 07:52:09 +02:00
|
|
|
return html + "'></div>";
|
|
|
|
}
|
|
|
|
var spinnerHTML = renderSpinner();
|
|
|
|
|
2021-04-12 08:26:22 +02:00
|
|
|
export default htmlHelper((params) => {
|
2017-10-09 07:52:09 +02:00
|
|
|
const hash = params.hash;
|
2021-04-12 08:26:22 +02:00
|
|
|
return renderSpinner(hash && hash.size ? hash.size : undefined);
|
2017-10-09 07:52:09 +02:00
|
|
|
});
|
|
|
|
|
|
|
|
export { spinnerHTML, renderSpinner };
|