Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(178)

Unified Diff: present/static/playground.js

Issue 6849074: code review 6849074: go.talks/present/playground.js: auto scroll output (Closed)
Patch Set: diff -r 6adfd6981649 https://code.google.com/p/go.talks Created 11 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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, "&lt;");
span.innerHTML = m;
span.className = className;
o.appendChild(span);
+ if (needScroll)
+ o.scrollTop = o.scrollHeight - o.offsetHeight;
}
function onMessage(e) {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b