X-Git-Url: http://mop.ddnsfree.com/gitweb/?a=blobdiff_plain;f=web%2Fcommons.js;h=3b79ddc1f4f45ed19223c08134e5707e5927ecd5;hb=0d462f547c388b20d72a9de96955484636736108;hp=342fc99bd659c07084ff3effa3c0bbf2ac87ffa7;hpb=51e3ccc452c854c6a372d51ab5ecab854bdc29c0;p=brisk.git diff --git a/web/commons.js b/web/commons.js index 342fc99..3b79ddc 100644 --- a/web/commons.js +++ b/web/commons.js @@ -841,6 +841,13 @@ var CHATT_MAXLINES = 40; /* PRO CHATT */ function chatt_sub(name,str) { + var must_scroll = false; + + // alert ($("txt").scrollTop + parseInt(getStyle($("txt"),"height", "height")) - $("txt").scrollHeight); + + if ($("txt").scrollTop + parseInt(getStyle($("txt"),"height", "height")) - $("txt").scrollHeight >= 0) + must_scroll = true; + // alert("ARRIVA NAME: "+ name + " STR:"+str); if (chatt_lines_n == CHATT_MAXLINES) { $("txt").innerHTML = ""; @@ -856,8 +863,13 @@ function chatt_sub(name,str) $("txt").innerHTML += chatt_lines[chatt_lines_n]; chatt_lines_n++; } - $("txt").innerHTML; - $("txt").scrollTop = 10000000; + // $("txt").innerHTML; + + + if (must_scroll) { + $("txt").scrollTop = 10000000; + } + // alert("scTOP "+$("txt").scrollTop+" scHEIGHT: "+$("txt").scrollHeight+" HEIGHT: "+getStyle($("txt"),"height", "height") ); } /*