瀏覽代碼

don't disrupt scrolling around in the history.

Lucas Stadler 11 年之前
父節點
當前提交
213b115eea
共有 1 個文件被更改,包括 3 次插入1 次删除
  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) {