Reviewers: golang-dev_googlegroups.com,
Message:
Hello [email protected] (cc: [email protected]),
I'd like you to review this change to
https://code.google.com/p/go.talks
Description:
go.talks/present/playground.js: auto scroll output
but only when the user scrolls to the bottom.
Please review this at http://codereview.appspot.com/6849074/
Affected files:
M present/static/playground.js
Index: present/static/playground.js
===================================================================
--- a/present/static/playground.js
+++ b/present/static/playground.js
@@ -9,11 +9,14 @@
function showMessage(o, m, className) {
var span = document.createElement("span");
+ var needScroll = (o.scrollTop + o.offsetHeight) == o.scrollHeight
m = m.replace(/&/g, "&");
m = m.replace(/</g, "<");
span.innerHTML = m;
span.className = className;
o.appendChild(span);
+ if (needScroll)
+ o.scrollByLines(1)
}
function onMessage(e) {