From 0b1ebbc02c5133d5e6dfb7beef843d937d6923b9 Mon Sep 17 00:00:00 2001 From: SukkaW Date: Sun, 7 Oct 2018 21:53:15 +0800 Subject: [PATCH] feat(nesting): max 4 layer nesting --- src/disqus.js | 30 +++++++++++++++++++++++------- src/disqusjs.css | 4 ++-- 2 files changed, 25 insertions(+), 9 deletions(-) diff --git a/src/disqus.js b/src/disqus.js index 6f3b995..f40f89e 100644 --- a/src/disqus.js +++ b/src/disqus.js @@ -487,8 +487,6 @@ function renderComment(data) { `; document.getElementById('disqus_thread').innerHTML = disqusjsBaseTpl; - - var commentBodyTpl = `
@@ -504,14 +502,26 @@ function renderComment(data) {
` + data.map(s => { childrenComments = (s) => { + var nesting = s.nesting + var children = (s.children || []); - if (typeof children === 'null') return; - var html = '