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' 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 MainContentContainer = document.getElementById('MainContent')
const MainContent = document.createElement('div') const MainContent = document.createElement('div')
MainContent.classList.add('page--container') if (!MainContentContainer.dataset['legacy']) {
MainContentContainer.append(MainContent) MainContent.classList.add('page--container')
MainContentContainer.append(MainContent)
const page = require('@a2nt/mithril-ui/src/js/ui/page/tpl') const page = require('@a2nt/mithril-ui/src/js/ui/page/tpl')
m.mount(MainContent, page) 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,13 +1,11 @@
<% cached 'HomePage', $LastEdited, $ID %> <% include PageHeader %>
<% include PageHeader %>
<% include Content ExcludeHeader=true %> <% include Content ExcludeHeader=true %>
<%-- div class="page-content page-content-main page-content-extra"> <%-- div class="page-content page-content-main page-content-extra">
<div class="element"> <div class="element">
<div class="element-container $DefaultContainer"> <div class="element-container $DefaultContainer">
<!-- Some exta page type specific content --> <!-- Some exta page type specific content -->
</div>
</div> </div>
</div --%> </div>
<% end_cached %> </div --%>