Explorar el Código

don't disrupt scrolling around in the history.

Lucas Stadler %!s(int64=11) %!d(string=hace) años
padre
commit
213b115eea
Se han modificado 1 ficheros con 3 adiciones y 1 borrados
  1. 3 1
      js/babl/public/index.html

+ 3 - 1
js/babl/public/index.html

@ -37,7 +37,9 @@
37 37
				var msgDate = new Date(msg.timestamp);
38 38
				msgEl.textContent = msgDate.toLocaleTimeString() + " - " + msg.author + ": " + msg.content;
39 39
				messagesEl.appendChild(msgEl);
40
				msgEl.scrollIntoView();
40
				if (window.scrollY >= window.scrollMaxY - 2 * inputEl.clientHeight) {
41
					msgEl.scrollIntoView();
42
				}
41 43
			}
42 44
43 45
			function handleMessage(msg) {