Pause app boot until window load event fired #21
@@ -13,6 +13,12 @@
|
||||
<link rel="stylesheet" href="{{rootURL}}assets/kredits-web.css">
|
||||
|
||||
{{content-for "head-footer"}}
|
||||
|
||||
<script>
|
||||
window.addEventListener('load', function() {
|
||||
window.windowLoadComplete = true;
|
||||
});
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
{{content-for "body"}}
|
||||
|
||||
@@ -6,9 +6,14 @@
|
||||
export default {
|
||||
name: 'defer-loading',
|
||||
initialize: function(application) {
|
||||
// Load event already fired, so web3 should be loaded if available
|
||||
if (window.windowLoadComplete) { return true; }
|
||||
|
||||
// Pause app loading
|
||||
application.deferReadiness();
|
||||
|
||||
window.addEventListener('load', function() {
|
||||
// Continue app loading
|
||||
application.advanceReadiness();
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user