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')
|
||||
MainContent.classList.add('page--container')
|
||||
MainContentContainer.append(MainContent)
|
||||
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)
|
||||
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,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="element">
|
||||
<div class="element-container $DefaultContainer">
|
||||
<!-- Some exta page type specific content -->
|
||||
</div>
|
||||
<%-- div class="page-content page-content-main page-content-extra">
|
||||
<div class="element">
|
||||
<div class="element-container $DefaultContainer">
|
||||
<!-- Some exta page type specific content -->
|
||||
</div>
|
||||
</div --%>
|
||||
<% end_cached %>
|
||||
</div>
|
||||
</div --%>
|
||||
|
Loading…
Reference in New Issue
Block a user