2019-05-22 23:04:37 +08:00

24 lines
900 B
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

function init() {
// 由于hexo分页不支持手工美化
var $nav = document.querySelector('#page-nav')
if ($nav && !document.querySelector('#page-nav .extend.prev')) {
$nav.innerHTML = '<a class="extend prev disabled" rel="prev">&laquo; Prev</a>' + $nav.innerHTML
}
if ($nav && !document.querySelector('#page-nav .extend.next')) {
$nav.innerHTML = $nav.innerHTML + '<a class="extend next disabled" rel="next">Next &raquo;</a>'
}
// 目录序号
if (window.themeConfig && window.themeConfig.toc_hide_index) {
let $a = document.querySelectorAll('.toc-number')
Array.prototype.forEach.call($a, function($em){
$em.style.display = 'none'
})
}
// 避免由于动画带来的fix元素定位失效, 移到动画元素外层
var sideOpt = document.querySelector('.wrap-side-operation')
document.getElementById('container').appendChild(sideOpt)
}
export default { init }