Browse Source

Fix new thread notifications title, fix thread body breaking script

Tried to access invalid child.
main
tmp-server 3 years ago
committed by discomrade
parent
commit
7876df0a50
  1. 5
      js/mod/recent-posts-auto-reload.js

5
js/mod/recent-posts-auto-reload.js

@ -191,9 +191,14 @@ $(document).ready(function(){
// check that this post doesn't already exist
if($('#' + id).length == 0) {
if (notify) {
if ($(this).hasClass('thread')){
var body = $(this).children('.post').children('.body').html().replace(/<br\s*[\/]?>/gi, "\n");
var n = new Notification("New thread in "+ title, {body: $('<div/>').html(body).text()});
} else {
var body = $(this).children('.body').html().replace(/<br\s*[\/]?>/gi, "\n");
var n = new Notification("New reply to "+ title, {body: $('<div/>').html(body).text()});
}
}
$(this).parent().insertBefore($('.post-wrapper:first'));
new_posts++;
loaded_posts++;

Loading…
Cancel
Save