mirror of
https://github.com/next-theme/hexo-theme-next.git
synced 2026-01-17 18:22:33 +00:00
Fix code highlight when copycode disabled
This commit is contained in:
parent
2446a19039
commit
3e8b35abf1
@ -88,7 +88,7 @@ NexT.boot.refresh = function() {
|
||||
CONFIG.pangu && window.pangu.spacingPage();
|
||||
|
||||
CONFIG.exturl && NexT.utils.registerExtURL();
|
||||
CONFIG.copycode.enable && NexT.utils.registerCopyCode();
|
||||
NexT.utils.registerCopyCode();
|
||||
NexT.utils.registerTabsTag();
|
||||
NexT.utils.registerActiveMenuItem();
|
||||
NexT.utils.registerLangSelect();
|
||||
|
||||
@ -70,6 +70,7 @@ NexT.utils = {
|
||||
span.classList.add(`hljs-${name}`);
|
||||
});
|
||||
});
|
||||
if (!CONFIG.copycode.enable) return;
|
||||
element.insertAdjacentHTML('beforeend', '<div class="copy-btn"><i class="fa fa-clipboard fa-fw"></i></div>');
|
||||
const button = element.querySelector('.copy-btn');
|
||||
button.addEventListener('click', event => {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user