From 8f27859cea10dee2f754a59e7af8a8c6761ad6a5 Mon Sep 17 00:00:00 2001 From: Jerry <16351105+jerryc127@users.noreply.github.com> Date: Mon, 3 Aug 2020 18:02:44 +0800 Subject: [PATCH] =?UTF-8?q?:bug:=20=E4=BF=AE=E5=BE=A9livere=E5=9C=A8pjax?= =?UTF-8?q?=E4=B8=8B=E7=9A=84bugs?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../includes/third-party/comments/livere.pug | 21 ++++++++++++------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/layout/includes/third-party/comments/livere.pug b/layout/includes/third-party/comments/livere.pug index faaa60e..45dc99e 100644 --- a/layout/includes/third-party/comments/livere.pug +++ b/layout/includes/third-party/comments/livere.pug @@ -1,13 +1,18 @@ script. function loadLivere () { - (function(d, s) { - var j, e = d.getElementsByTagName(s)[0]; - if (typeof LivereTower === 'function') { return; } - j = d.createElement(s); - j.src = 'https://cdn-city.livere.com/js/embed.dist.js'; - j.async = true; - e.parentNode.insertBefore(j, e); - })(document, 'script'); + if (typeof LivereTower === 'object') { + window.LivereTower.init() + } + else { + (function(d, s) { + var j, e = d.getElementsByTagName(s)[0]; + if (typeof LivereTower === 'function') { return; } + j = d.createElement(s); + j.src = 'https://cdn-city.livere.com/js/embed.dist.js'; + j.async = true; + e.parentNode.insertBefore(j, e); + })(document, 'script'); + } } if ('!{theme.comments.use[0]}' === 'Livere' || !!{theme.comments.lazyload}) {