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'
|
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')
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@ -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 --%>
|
||||||
|
Loading…
Reference in New Issue
Block a user