2018-01-19 08:51:51 +00:00
|
|
|
<div class="lazy-timeline">
|
2018-01-27 18:46:52 +00:00
|
|
|
{{#if !$initialized}}
|
2018-01-15 07:24:27 +00:00
|
|
|
<div transition:fade>
|
2018-01-19 08:51:51 +00:00
|
|
|
<div class="loading-page">
|
|
|
|
<LoadingSpinner />
|
|
|
|
</div>
|
2018-01-15 07:24:27 +00:00
|
|
|
</div>
|
|
|
|
{{/if}}
|
2018-01-19 08:51:51 +00:00
|
|
|
{{#await promise}}
|
|
|
|
{{then constructor}}
|
2018-01-27 18:46:52 +00:00
|
|
|
<:Component {constructor} :timeline />
|
2018-01-19 08:51:51 +00:00
|
|
|
{{catch error}}
|
|
|
|
<div>Component failed to load. Please try refreshing! {{error}}</div>
|
|
|
|
{{/await}}
|
2018-01-15 07:24:27 +00:00
|
|
|
</div>
|
|
|
|
<style>
|
2018-01-19 08:51:51 +00:00
|
|
|
.lazy-timeline {
|
2018-01-15 07:24:27 +00:00
|
|
|
width: 100%;
|
2018-01-19 08:51:51 +00:00
|
|
|
min-height: 60vh;
|
|
|
|
}
|
|
|
|
.loading-page {
|
|
|
|
position: absolute;
|
|
|
|
top: 0;
|
|
|
|
left: 0;
|
|
|
|
bottom: 0;
|
|
|
|
right: 0;
|
2018-01-15 07:24:27 +00:00
|
|
|
display: flex;
|
|
|
|
align-items: center;
|
|
|
|
justify-content: center;
|
2018-01-19 08:51:51 +00:00
|
|
|
z-index: 50
|
2018-01-15 07:24:27 +00:00
|
|
|
}
|
|
|
|
</style>
|
|
|
|
<script>
|
2018-01-28 00:35:44 +00:00
|
|
|
import { importTimeline } from '../../_utils/asyncModules'
|
|
|
|
import LoadingSpinner from '../LoadingSpinner.html'
|
2018-01-15 07:24:27 +00:00
|
|
|
import { fade } from 'svelte-transitions'
|
2018-01-28 00:35:44 +00:00
|
|
|
import { store } from '../../_utils/store'
|
2018-01-15 07:24:27 +00:00
|
|
|
|
|
|
|
export default {
|
2018-01-27 18:46:52 +00:00
|
|
|
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,
|
2018-01-15 07:24:27 +00:00
|
|
|
data: () => ({
|
2018-01-27 18:46:52 +00:00
|
|
|
promise: importTimeline()
|
2018-01-15 07:24:27 +00:00
|
|
|
}),
|
|
|
|
components: {
|
|
|
|
LoadingSpinner
|
|
|
|
},
|
|
|
|
transitions: {
|
|
|
|
fade
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</script>
|