s4

changeset 981:eb51a80f73c2

Divide task of ReplyHover()
author HIROSE Yuuji <yuuji@gentei.org>
date Tue, 31 May 2022 11:59:33 +0900
parents f0b63223cb80
children f5a7fbd6c0d0
files s4-main.js
diffstat 1 files changed, 9 insertions(+), 6 deletions(-) [+]
line diff
     1.1 --- a/s4-main.js	Tue May 31 11:52:46 2022 +0900
     1.2 +++ b/s4-main.js	Tue May 31 11:59:33 2022 +0900
     1.3 @@ -184,7 +184,7 @@
     1.4  		localntr.classList.remove("dissolving");
     1.5  		localntr.classList.add("emerging");
     1.6  	    }, 100);
     1.7 -	    initReplyHover(ntr);
     1.8 +	    rewriteReplyHover(ntr);
     1.9  	    cnt++;
    1.10  	}
    1.11  	mathjaxUpdate(newids);
    1.12 @@ -1034,7 +1034,7 @@
    1.13  	});
    1.14  	ta.parentNode.appendChild(btn);
    1.15      }
    1.16 -    function initReplyHover(unit) {
    1.17 +    function rewriteReplyHover(unit) {
    1.18  	function getTextById(id) {
    1.19  	    let repltd = document.getElementById(id);
    1.20  	    if (repltd) {
    1.21 @@ -1071,6 +1071,12 @@
    1.22  	    }
    1.23  	}
    1.24      }
    1.25 +    function initReplyHover(unit) {
    1.26 +	if (mathjax && MathJax.startup)
    1.27 +	    MathJax.startup.promise.then(()=>rewriteReplyHover());
    1.28 +	else
    1.29 +	    rewriteReplyHover();
    1.30 +    }
    1.31      function init() {
    1.32  	isOlderJS = !("insertAdjacentElement" in document.body);
    1.33  	initGrpAction();
    1.34 @@ -1079,10 +1085,7 @@
    1.35  	initTextarea();
    1.36  	initGrphome();
    1.37  	initMath();
    1.38 -	if (mathjax && MathJax.startup)
    1.39 -	    MathJax.startup.promise.then(()=>initReplyHover());
    1.40 -	else
    1.41 -	    initReplyHover(); 
    1.42 +	initReplyHover();
    1.43      }
    1.44      document.addEventListener('DOMContentLoaded', init, null);
    1.45  })();