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

32 lines
900 B
Plaintext
Raw Normal View History

<%- __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-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.loadingProgressBarStart();
});
document.addEventListener('pjax:complete', () => {
KEEP.utils.loadingProgressBarEnd();
pjax.executeScripts(document.querySelectorAll('script[data-pjax], .pjax script'));
2021-01-06 18:36:28 +08:00
KEEP.refresh();
});
});
</script>