Skip to content

Commit

Permalink
Moved loading indicator code to shared constant
Browse files Browse the repository at this point in the history
  • Loading branch information
distributive committed Sep 26, 2022
1 parent 0144280 commit 2dbb5a2
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion app/Resources/views/Banlists/banlists.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ async function buildBanlistsView() {
$('#restrictions-root').show();
// Add a temporary loading indicator
$('.tab-pane').append('<p class="temp-loading text-center"><span class="loading-icon"><span class="loading-icon-red"></span><span class="loading-icon-blue"></span><span class="loading-icon-overlap"></span></span>Loading...</p>');
$('.tab-pane').append(loading_icon);
// Load data from API
const desiredFormats = ['startup', 'standard', 'eternal'];
Expand Down
2 changes: 1 addition & 1 deletion app/Resources/views/Formats/formats.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
<script>
async function buildFormatsView() {
// Add a temporary loading indicator
$('#formats').append('<p class="temp-loading text-center"><span class="loading-icon"><span class="loading-icon-red"></span><span class="loading-icon-blue"></span><span class="loading-icon-overlap"></span></span>Loading...</p>');
$('#formats').append(loading_icon);
// Load api data
const desiredFormats = new Set(['eternal', 'standard', 'startup']);
Expand Down
3 changes: 2 additions & 1 deletion app/Resources/views/layout.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,8 @@
locale: '{{ app.request.locale }}'
};
moment.locale(window.navigator.language);
var v3_api_url = '{{ v3_api_url }}';
const v3_api_url = '{{ v3_api_url }}';
const loading_icon = '<p class="temp-loading text-center"><span class="loading-icon"><span class="loading-icon-red"></span><span class="loading-icon-blue"></span><span class="loading-icon-overlap"></span></span>Loading...</p>';
</script>
{% if app.environment == 'prod' %}
<!-- Global site tag (gtag.js) - Google Analytics -->
Expand Down

0 comments on commit 2dbb5a2

Please sign in to comment.