aboutsummaryrefslogtreecommitdiffstats
path: root/view/theme/redbasic/js/redbasic.js
diff options
context:
space:
mode:
Diffstat (limited to 'view/theme/redbasic/js/redbasic.js')
-rw-r--r--view/theme/redbasic/js/redbasic.js12
1 files changed, 4 insertions, 8 deletions
diff --git a/view/theme/redbasic/js/redbasic.js b/view/theme/redbasic/js/redbasic.js
index b502ad333..706bf2808 100644
--- a/view/theme/redbasic/js/redbasic.js
+++ b/view/theme/redbasic/js/redbasic.js
@@ -26,14 +26,10 @@ $(document).ready(function() {
// provide a fake progress bar for pwa standalone mode
if (window.matchMedia('(display-mode: standalone)').matches) {
$(window).on('beforeunload', function(){
- $('<div style="position:fixed; z-index:10000; height:2px;" class="bg-primary page-loader"></div>').prependTo('body');
- let w = 10;
- setInterval(function () {
- $('.page-loader').css('width', w + 'vw');
- if (w < 90) {
- w = w+2;
- }
- }, 10);
+ if ($('.page-loader').length) {
+ return;
+ }
+ $('<div class="bg-primary page-loader"></div>').prependTo('body');
});
}