diff --git a/js/hide-threads.js b/js/hide-threads.js
index 783b7bec..64f0a384 100644
--- a/js/hide-threads.js
+++ b/js/hide-threads.js
@@ -13,7 +13,7 @@
*/
$(document).ready(function(){
- if (active_page != "index" && active_page != "ukko")
+ if (active_page != "index" && active_page != "ukko" && active_page != "thread")
return; // not index
if (!localStorage.hiddenthreads)
@@ -83,8 +83,12 @@ $(document).ready(function(){
var id = post.children('p.intro').children('a.post_no:eq(1)').text();
var board = post.parent().data('board');
+ if (!hidden_data[board]) {
+ hidden_data[board] = {}; // id : timestamp
+ }
+
$('[–]')
- .insertAfter($(this).children('p.intro').children('a.post_no:last'))
+ .insertAfter(post.children('p.intro').children('a.post_no:last'))
.click(function() {
hidden_data[board][id] = Math.round(Date.now() / 1000);
store_data();
@@ -92,7 +96,7 @@ $(document).ready(function(){
post.children('div').hide();
hide_link.hide();
$('[+]')
- .insertAfter($(this).children('p.intro').children('a.post_no:last'))
+ .insertAfter(post.children('p.intro').children('a.post_no:last'))
.click(function() {
delete hidden_data[board][id];
store_data();
@@ -105,8 +109,8 @@ $(document).ready(function(){
if (hidden_data[board][id])
post.find('.post-hide-link').click();
}
-
- $('div.post.op').each(do_hide_threads);
+ if (active_page != "thread")
+ $('div.post.op').each(do_hide_threads);
$('div.post.reply').each(do_hide_posts);
$(document).on('new_post', function(e, post) {