hexo-theme-keep/layout/_partial/pjax/pjax.ejs

31 lines
894 B
Plaintext
Raw Normal View History

<%- __js('js/libs/pjax.min.js') %>
<script>
window.addEventListener('DOMContentLoaded', () => {
window.pjax = new Pjax({
selectors: [
'head title',
'.page-container',
2021-01-06 18:36:28 +08:00
'.pjax'
],
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,
});
2021-01-06 18:36:28 +08:00
document.addEventListener('pjax:send', () => {
KEEP.utils.pjaxProgressBarStart();
2021-01-06 18:36:28 +08:00
});
document.addEventListener('pjax:complete', () => {
KEEP.utils.pjaxProgressBarEnd();
pjax.executeScripts(document.querySelectorAll('script[data-pjax], .pjax script'));
2021-01-06 18:36:28 +08:00
KEEP.refresh();
});
});
</script>