IMPR: Legacy pages fallback

This commit is contained in:
Tony Air 2023-11-27 17:19:45 +02:00
parent 3fd711afd3
commit e82650327b
2 changed files with 28 additions and 15 deletions

View File

@ -1,11 +1,26 @@
import '@a2nt/mithril-ui/src/js/ui'
const m = require("mithril") // eslint-disable-line
import Events from '@a2nt/ss-bootstrap-ui-webpack-boilerplate-react/src/js/_events'
const m = require("mithril") // eslint-disable-line
const MainContentContainer = document.getElementById('MainContent')
const MainContent = document.createElement('div')
if (!MainContentContainer.dataset['legacy']) {
MainContent.classList.add('page--container')
MainContentContainer.append(MainContent)
const page = require('@a2nt/mithril-ui/src/js/ui/page/tpl')
m.mount(MainContent, page)
} else {
// legacy fallback
const spinner = document.getElementById('PageLoading')
if (spinner) {
window.addEventListener(`${Events.LOADED}`, () => {
spinner.classList.add('d-none')
})
window.addEventListener(`${Events.AJAX}`, () => {
spinner.classList.add('d-none')
})
}
}

View File

@ -1,4 +1,3 @@
<% cached 'HomePage', $LastEdited, $ID %>
<% include PageHeader %>
<% include Content ExcludeHeader=true %>
@ -10,4 +9,3 @@
</div>
</div>
</div --%>
<% end_cached %>