mirror of
https://github.com/a2nt/silverstripe-webpack.git
synced 2024-10-22 17:05:31 +02:00
IMPR: Legacy pages fallback
This commit is contained in:
parent
3fd711afd3
commit
e82650327b
@ -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')
|
||||
})
|
||||
}
|
||||
}
|
||||
|
@ -1,4 +1,3 @@
|
||||
<% cached 'HomePage', $LastEdited, $ID %>
|
||||
<% include PageHeader %>
|
||||
|
||||
<% include Content ExcludeHeader=true %>
|
||||
@ -10,4 +9,3 @@
|
||||
</div>
|
||||
</div>
|
||||
</div --%>
|
||||
<% end_cached %>
|
||||
|
Loading…
Reference in New Issue
Block a user