58 lines
1.4 KiB
HTML
58 lines
1.4 KiB
HTML
<div class="lazy-timeline">
|
|
{{#if !$initialized}}
|
|
<!-- <div transition:fade> -->
|
|
<div class="loading-page">
|
|
<LoadingSpinner />
|
|
</div>
|
|
<!-- </div> -->
|
|
{{/if}}
|
|
{{#await promise}}
|
|
{{then constructor}}
|
|
<:Component {constructor} :timeline />
|
|
{{catch error}}
|
|
<div>Component failed to load. Try refreshing! {{error}}</div>
|
|
{{/await}}
|
|
</div>
|
|
<style>
|
|
.lazy-timeline {
|
|
width: 100%;
|
|
min-height: 60vh;
|
|
}
|
|
.loading-page {
|
|
position: fixed;
|
|
top: 0;
|
|
left: 0;
|
|
bottom: 0;
|
|
right: 0;
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
z-index: 50;
|
|
}
|
|
</style>
|
|
<script>
|
|
import { importTimeline } from '../../_utils/asyncModules'
|
|
import LoadingSpinner from '../LoadingSpinner.html'
|
|
// TODO: the transition seems to occasionally cause an error in Svelte, transition_run is undefined
|
|
//import { fade } from 'svelte-transitions'
|
|
import { store } from '../../_store/store'
|
|
|
|
export default {
|
|
oncreate() {
|
|
let instanceName = this.store.get('currentInstance')
|
|
let timeline = this.get('timeline')
|
|
this.store.set({currentTimeline: timeline})
|
|
this.store.setForTimeline(instanceName, timeline, {runningUpdate: false})
|
|
},
|
|
store: () => store,
|
|
data: () => ({
|
|
promise: importTimeline()
|
|
}),
|
|
components: {
|
|
LoadingSpinner
|
|
}/*,
|
|
transitions: {
|
|
fade
|
|
}*/
|
|
}
|
|
</script> |