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',
|
2021-01-06 18:36:28 +08:00
|
|
|
'.pjax'
|
2020-12-30 18:11:46 +08:00
|
|
|
],
|
2020-12-31 16:38:31 +08:00
|
|
|
history: true,
|
|
|
|
debug: false,
|
2021-01-05 15:39:21 +08:00
|
|
|
cacheBust: false,
|
2021-01-05 17:01:15 +08:00
|
|
|
timeout: 0,
|
2021-01-06 18:36:28 +08:00
|
|
|
analytics: false,
|
|
|
|
currentUrlFullReload: false,
|
|
|
|
scrollRestoration: false,
|
2021-01-05 15:39:21 +08:00
|
|
|
// scrollTo: true,
|
2020-12-30 18:11:46 +08:00
|
|
|
});
|
|
|
|
|
2021-01-06 18:36:28 +08:00
|
|
|
|
|
|
|
document.addEventListener('pjax:send', () => {
|
|
|
|
KEEP.utils.loadingProgressBarStart();
|
|
|
|
});
|
|
|
|
|
|
|
|
document.addEventListener('pjax:complete', () => {
|
|
|
|
KEEP.utils.loadingProgressBarEnd();
|
2020-12-30 18:11:46 +08:00
|
|
|
pjax.executeScripts(document.querySelectorAll('script[data-pjax], .pjax script'));
|
2021-01-06 18:36:28 +08:00
|
|
|
KEEP.refresh();
|
2020-12-30 18:11:46 +08:00
|
|
|
});
|
|
|
|
});
|
|
|
|
</script>
|