Fix code highlight when copycode disabled

This commit is contained in:
Mimi 2020-06-13 23:14:03 +08:00
parent 2446a19039
commit 3e8b35abf1
2 changed files with 2 additions and 1 deletions

View File

@ -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();

View File

@ -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 => {