2020-12-30 18:11:46 +08:00
|
|
|
<%- __js('js/libs/pjax.min.js') %>
|
|
|
|
<script>
|
|
|
|
window.addEventListener('DOMContentLoaded', () => {
|
|
|
|
const pjax = new Pjax({
|
|
|
|
selectors: [
|
|
|
|
'head title',
|
|
|
|
'.page-container',
|
|
|
|
'.pjax',
|
|
|
|
],
|
2020-12-31 16:38:31 +08:00
|
|
|
history: true,
|
2020-12-30 18:11:46 +08:00
|
|
|
cacheBust: false,
|
|
|
|
currentUrlFullReload: false,
|
2020-12-31 16:38:31 +08:00
|
|
|
timeout: 0,
|
|
|
|
scrollTo: false,
|
|
|
|
scrollRestoration: false,
|
|
|
|
debug: false,
|
2020-12-30 18:11:46 +08:00
|
|
|
});
|
|
|
|
|
|
|
|
window.addEventListener('pjax:complete', () => {
|
|
|
|
|
|
|
|
KEEP.refresh();
|
|
|
|
pjax.executeScripts(document.querySelectorAll('script[data-pjax], .pjax script'));
|
|
|
|
});
|
|
|
|
});
|
|
|
|
</script>
|