🏗️ First time sync the css & js files from hexo theme NexT
This commit is contained in:
34
assets/js/pjax.js
Normal file
34
assets/js/pjax.js
Normal file
@@ -0,0 +1,34 @@
|
||||
/* global NexT, CONFIG, Pjax */
|
||||
|
||||
const pjax = new Pjax({
|
||||
selectors: [
|
||||
'head title',
|
||||
'script[type="application/json"]',
|
||||
'.main-inner',
|
||||
'.post-toc-wrap',
|
||||
'.languages',
|
||||
'.pjax'
|
||||
],
|
||||
analytics: false,
|
||||
cacheBust: false,
|
||||
scrollTo : !CONFIG.bookmark.enable
|
||||
});
|
||||
|
||||
document.addEventListener('pjax:success', () => {
|
||||
pjax.executeScripts(document.querySelectorAll('script[data-pjax]'));
|
||||
NexT.boot.refresh();
|
||||
// Define Motion Sequence & Bootstrap Motion.
|
||||
if (CONFIG.motion.enable) {
|
||||
NexT.motion.integrator
|
||||
.init()
|
||||
.add(NexT.motion.middleWares.subMenu)
|
||||
.add(NexT.motion.middleWares.postList)
|
||||
.bootstrap();
|
||||
}
|
||||
if (CONFIG.sidebar.display !== 'remove') {
|
||||
const hasTOC = document.querySelector('.post-toc');
|
||||
document.querySelector('.sidebar-inner').classList.toggle('sidebar-nav-active', hasTOC);
|
||||
NexT.utils.activateSidebarPanel(hasTOC ? 0 : 1);
|
||||
NexT.utils.updateSidebarPosition();
|
||||
}
|
||||
});
|
||||
Reference in New Issue
Block a user