summaryrefslogtreecommitdiff
path: root/js/id_colors.js
diff options
context:
space:
mode:
author8chan <admin@8chan.co>2014-09-27 20:17:31 +0000
committerczaks <marcin@6irc.net>2014-10-05 17:48:07 +0200
commitf8178dcbe4c23c930b865c993c8f5ab8c831e59c (patch)
treef17c9a7903bc9a0af3cad84dd47370961239a50d /js/id_colors.js
parent035f8437abe8713678b7cb3e301446419028593b (diff)
Color IDs on new posts received via AJAX
Diffstat (limited to 'js/id_colors.js')
-rw-r--r--js/id_colors.js12
1 files changed, 11 insertions, 1 deletions
diff --git a/js/id_colors.js b/js/id_colors.js
index 7d531fde..e0795b75 100644
--- a/js/id_colors.js
+++ b/js/id_colors.js
@@ -23,7 +23,7 @@ if (active_page == 'thread' || active_page == 'index') {
return rgb;
}
- $(".poster_id").each(function(){
+ function colorPostId(el) {
var rgb = stringToRGB($(this).text());
$(this).css({
@@ -32,6 +32,16 @@ if (active_page == 'thread' || active_page == 'index') {
"border-radius": "8px",
"color": "white"
});
+ }
+
+ $(".poster_id").each(function(k, v){
+ colorPostId(v);
+ });
+
+ $(document).on('new_post', function(e, post) {
+ $(post).find('.poster_id').each(function(k, v) {
+ colorPostId(v);
+ });
});
});
}