通过判断height来判断评论是否加载成功
This commit is contained in:
parent
f32f4d3bec
commit
9960d8f885
@ -150,24 +150,18 @@ function openComments(){
|
||||
}
|
||||
|
||||
function iFrameLoading(){
|
||||
utterancesFrame=document.getElementsByClassName("utterances-frame")[0];
|
||||
if(utterancesFrame!=null){
|
||||
if (utterancesFrame.attachEvent){
|
||||
utterancesFrame.attachEvent("onload", function(){iFrameOK();});
|
||||
}
|
||||
else {
|
||||
utterancesFrame.onload = function(){iFrameOK();};
|
||||
var utterances=document.getElementsByClassName('utterances');
|
||||
if(utterances.length==1){
|
||||
if(utterances.style.height!=""){
|
||||
utterancesLoad=1;
|
||||
int=window.clearInterval(int);
|
||||
document.getElementById("comments").setAttribute("style","border-top: 1px solid var(--color-border-default);margin-top:64px;");
|
||||
document.getElementById("cmButton").style.display="none";
|
||||
console.log("utterances Load OK");
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
function iFrameOK(){
|
||||
utterancesLoad=1;
|
||||
int=window.clearInterval(int);
|
||||
document.getElementById("comments").setAttribute("style","border-top: 2px solid var(--color-border-default);margin-top:64px;");
|
||||
document.getElementById("cmButton").style.display="none";
|
||||
console.log("utterances Load OK");
|
||||
}
|
||||
|
||||
</script>
|
||||
</html>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user