Unverified Commit 35059b46 authored by Aral Balkan's avatar Aral Balkan
Browse files

Fixed the scrolling ahead issue on the All Friends timeline when loading older posts.

parent fe477b75
......@@ -276,30 +276,6 @@ window.addEventListener('load', function(){
messageRepeater.parentNode.removeChild(messageRepeater);
}
//
// 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){
mutations.forEach(function(mutation){
if(mutation.type == "childList") {
var addedNodes = mutation.addedNodes;
var forEach = Array.prototype.forEach;
forEach.call(addedNodes, function(node){
// Scroll the added node into view.
zenscroll.intoView(node, 750);
});
}
});
});
// Currently, we only care when the child list changes.
var mutationObserverOptions = {childList: true};
var messages = document.getElementById('messages');
mutationObserver.observe(messages, mutationObserverOptions);
//
// Poll every two seconds for new messages.
//
......
......@@ -12,8 +12,6 @@ function insertAfter(parentNode, referenceNode, newNode) {
parentNode.insertBefore(newNode, nodeToInsertBefore);
}
var topmostElementBeforeLoadingOlderMessages = null
function massageAssetURLsInMessages(messages){
// Massage the asset URLs
......@@ -32,6 +30,9 @@ function massageAssetURLsInMessages(messages){
return messages;
}
var topmostElementBeforeLoadingOlderMessages = null;
function getOlderMessages(){
console.log("Polling server for older messages…")
......
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