Use script to control comments container show.

This commit is contained in:
凡梦星尘
2022-07-22 18:35:04 +08:00
parent 31f6e21671
commit d42375820d
11 changed files with 97 additions and 95 deletions

View File

@@ -63,6 +63,8 @@ NexT.utils = {
* One-click copy code support.
*/
registerCopyCode: function() {
if (!NexT.CONFIG.copybtn) return;
let figure = document.querySelectorAll('.highlight pre');
if (figure.length === 0 || !NexT.CONFIG.copybtn) return;
figure.forEach(element => {
@@ -277,7 +279,7 @@ NexT.utils = {
});
},
initCommontesDispaly: function(){
initCommontesDispaly: function(){
const comms = document.querySelectorAll('.comment-wrap > div');
if (comms.length<=1) return;
comms.forEach(function(item){
@@ -302,6 +304,10 @@ NexT.utils = {
});
},
hideCommontes:function() {
document.querySelector('.post-comments').style.display = 'none';
},
hiddeLodingCmp: function(selector) {
const loadding = document.querySelector(selector).previousElementSibling;
loadding.style.display = 'none';