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