diff --git a/dashboard_static/js/code.js b/dashboard_static/js/code.js index f2b9694..df47e51 100644 --- a/dashboard_static/js/code.js +++ b/dashboard_static/js/code.js @@ -1,4 +1,5 @@ let selectedSports = [] +let paused = false; let filters = { searchedWords: [], diff --git a/dashboard_static/js/events.js b/dashboard_static/js/events.js index 38d19c0..843991c 100644 --- a/dashboard_static/js/events.js +++ b/dashboard_static/js/events.js @@ -72,11 +72,13 @@ $(window).on("filter", function() { tweets = filterTweets(tweets, filters.blockedWords, filters.searchedWords.concat(filters.sports), filters.sorted, filters.order); tweets = sortTweets(tweets, {"sortby":filters.sorted, "order":filters.order}); var displayTweets = tweets.reverse().slice(0, 20).reverse(); - if(tweetCell(displayTweets[0]) != lastTweet){ - parent.replaceChildren(); - for (i = 0; i < Math.min(19, displayTweets.length); i++){ - tweet = displayTweets[i]; - parent.prepend(tweetCell(tweet)); + if(!paused) { + if(tweetCell(displayTweets[0]) != lastTweet){ + parent.replaceChildren(); + for (i = 0; i < Math.min(19, displayTweets.length); i++){ + tweet = displayTweets[i]; + parent.prepend(tweetCell(tweet)); + } } } }) diff --git a/dashboard_static/lib/tweets.js b/dashboard_static/lib/tweets.js index 3addfcb..0f36c3b 100644 --- a/dashboard_static/lib/tweets.js +++ b/dashboard_static/lib/tweets.js @@ -86,13 +86,14 @@ block.fn.tweets = function(config) { tweets.shift(); } window.sessionStorage.setItem('tweets', JSON.stringify(tweets)); - + if(!paused) { // remove tweets $list.replaceChildren(); var displayTweets = tweets.reverse().slice(0, options.memory).reverse(); for (i = 0; i < Math.min(options.memory-1, displayTweets.length); i++){ $list.prepend(tweetCell(displayTweets[i])); } + } });