Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Ind.ie Projects
Heartbeat Node
Commits
35059b46
Unverified
Commit
35059b46
authored
Aug 31, 2015
by
Aral Balkan
Browse files
Fixed the scrolling ahead issue on the All Friends timeline when loading older posts.
parent
fe477b75
Changes
2
Hide whitespace changes
Inline
Side-by-side
private/views/js/all-friends.js
View file @
35059b46
...
...
@@ -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.
//
...
...
private/views/js/conversation.js
View file @
35059b46
...
...
@@ -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…
"
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment