Added function to put all in a single list
This commit is contained in:
@@ -80,6 +80,14 @@ block.fn.tweets = function(config) {
|
||||
|
||||
// register default handler for handling tweet data
|
||||
this.actions(function(e, tweet){
|
||||
tweets = window.sessionStorage.getItem('tweets');
|
||||
tweets = JSON.parse(tweets);
|
||||
tweets.push(tweet);
|
||||
if(tweets.length >= options.memory) {
|
||||
tweets.shift();
|
||||
}
|
||||
window.sessionStorage.setItem('tweets', JSON.stringify(tweets));
|
||||
|
||||
var $item = $('<li class="stream-item"></li>');
|
||||
|
||||
var $tweet = $('<div class="tweet"></div>');
|
||||
|
||||
Reference in New Issue
Block a user