2020-12-30 18:11:46 +08:00
|
|
|
<%- __js('js/libs/pjax.min.js') %>
|
|
|
|
<script>
|
|
|
|
window.addEventListener('DOMContentLoaded', () => {
|
2021-04-26 16:57:05 +08:00
|
|
|
window.pjax = new Pjax({
|
2020-12-30 18:11:46 +08:00
|
|
|
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', () => {
|
2021-01-10 23:49:25 +08:00
|
|
|
KEEP.utils.pjaxProgressBarStart();
|
2021-01-06 18:36:28 +08:00
|
|
|
});
|
|
|
|
|
|
|
|
document.addEventListener('pjax:complete', () => {
|
2021-01-10 23:49:25 +08:00
|
|
|
KEEP.utils.pjaxProgressBarEnd();
|
2021-04-26 17:35:58 +08:00
|
|
|
window.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>
|