This commit is contained in:
amehime
2020-09-23 22:33:53 +08:00
parent 485c8c0649
commit b045672a56
2 changed files with 7 additions and 5 deletions

View File

@@ -256,7 +256,7 @@ const clipBoard = function(str, callback) {
BODY.removeChild(ta);
}
const loadRecentComment = function (root) {
const loadRecentComment = function (pjax) {
// set serverURLs
var prefix = 'https://'
var serverURLs = ''
@@ -283,7 +283,7 @@ const loadRecentComment = function (root) {
appKey: options.appKey,
serverURLs: serverURLs
})
var el = $('#rcomment')
AV.Query.doCloudQuery(
"select nick, mail, comment, url from Comment where (rid='' or rid is not exists) order by -createdAt limit 0,10"
).then(function(rets){
@@ -299,9 +299,11 @@ const loadRecentComment = function (root) {
+'</li>'
}
$('#rcomment').createChild('ul', {
el.createChild('ul', {
innerHTML: html
})
pjax.refresh(el);
}
}).catch(function(e){})
} catch (e) {}

View File

@@ -27,8 +27,6 @@ const domInit = function() {
showContents.addEventListener('click', sideBarToggleHandle);
toolPlayer.player();
loadRecentComment();
}
@@ -47,6 +45,7 @@ const pjaxReload = function () {
$('#content').innerHTML = ''
$('#content').appendChild(loadCat.lastChild.cloneNode(true));
pageScroll(BODY);
}
const siteRefresh = function (reload) {
@@ -107,6 +106,7 @@ const siteInit = function () {
themeColorListener()
algoliaSearch(pjax)
loadRecentComment(pjax)
window.addEventListener('scroll', scrollHandle)