There is a chat, and when new message comes in it needs to scroll down. This works fine.
But when app is loaded some portion of messages are preloaded (about 100 of them) via setting the ‘content’ of the ArrayController, so scrolling down will be called 100 times which is not good. What is the right way to run scroll just once for the first big portion of data?
Here is some code http://jsfiddle.net/agentcooper/W6Bhs/
You could create a
scrollfunction which is fired when your content changes, see http://jsfiddle.net/pangratz666/zZ5Cc. So you’d basically pull up the scrolling behavior from the view which holds a single message to the view which holds all messages.Handlebars:
JavaScript: