Unverified Commit eed1bcc9 authored by Aral Balkan's avatar Aral Balkan
Browse files

All friends timeline now scrolls to show you the latest tweet that is received.

parent efbde781
......@@ -15,6 +15,42 @@ window.addEventListener('load', function(){
// Listen for mutations on messages so that we can intelligently respond to them.
// e.g., scroll to show a message when one arrives.
var mutationObserver = new MutationObserver(function(mutations){
console.log("Mutations received:");
console.log("Mutation: " + mutation.type);
console.log("Mutation target: ");
if(mutation.type == "childList") {
console.log("Added nodes:");
var addedNodes = mutation.addedNodes;
// Because, JavaScript, innit?
// Some working group somewhere thought, hey, why the fuck not?
var forEach = Array.prototype.forEach;
forEach.call(addedNodes, function(node){
// Currently, we only care when the child list changes.
var mutationObserverOptions = {childList: true};
mutationObserver.observe(messages, mutationObserverOptions);
// Poll every two seconds for new messages.
// console.log("Polling server for new public posts…")
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment