Skip to content

Commit

Permalink
Fix race condition
Browse files Browse the repository at this point in the history
  • Loading branch information
cuom1999 committed Jun 24, 2024
1 parent b14f7b1 commit 7c0e601
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 9 deletions.
11 changes: 11 additions & 0 deletions resources/common.js
Original file line number Diff line number Diff line change
Expand Up @@ -566,6 +566,17 @@ function isEligibleLinkToRegister($e) {
);
};

function replaceLoadingPage(reload_container) {
const loadingPage = `
<div style="height: 80vh; margin: 0; display: flex; align-items: center; justify-content: center; width: 100%; font-size: xx-large;">
<i class="fa fa-spinner fa-pulse"></i>
</div>
`;
$(reload_container).fadeOut(1000, function() {
$(this).html(loadingPage).fadeIn(200);
});
}

function registerNavigation() {
const containerMap = {
'.left-sidebar-item': '.middle-right-content',
Expand Down
9 changes: 0 additions & 9 deletions templates/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -102,15 +102,6 @@
{% else %}
<script src="{{ static('libs/jquery-3.4.1.min.js') }}"></script>
{% endif %}
<script>
function replaceLoadingPage(reload_container) {
$.get("{{static('html/loading-page.html')}}", function(data) {
$(reload_container).fadeOut(500, function() {
$(this).html(data).fadeIn(50);
});
});
}
</script>
</head>
<body>
<svg width="0" height="0" style="display: block">
Expand Down

0 comments on commit 7c0e601

Please sign in to comment.