diff --git a/post_example.html b/post_example.html index 431be3b..f8e8d65 100644 --- a/post_example.html +++ b/post_example.html @@ -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"); -} -