Highlight IDs on new posts received via AJAX

This commit is contained in:
8chan 2014-09-27 20:23:27 +00:00
parent de0328f329
commit 150480f3fc

View File

@ -23,7 +23,7 @@ if (active_page == 'thread' || active_page == 'index') {
return toRet; return toRet;
} }
$(".poster_id").click(function(){ var id_highlighter = function(){
var id = $(this).text(); var id = $(this).text();
if($.inArray(id, idshighlighted) !== -1){ if($.inArray(id, idshighlighted) !== -1){
@ -39,6 +39,12 @@ if (active_page == 'thread' || active_page == 'index') {
$(this).addClass("highlighted"); $(this).addClass("highlighted");
}); });
} }
}
$(".poster_id").on('click', id_highlighter);
$(document).on('new_post', function(e, post) {
$(post).find('.poster_id').on('click', id_highlighter);
}); });
}); });
} }