forked from leftypol/leftypol
Fix new thread notifications breaking script
Tried to access invalid child.
This commit is contained in:
parent
3112d6486b
commit
807adaff90
|
@ -220,7 +220,11 @@ $(document).ready(function(){
|
|||
}
|
||||
// Notify on all posts, not just the first unread
|
||||
if (notify === "all") {
|
||||
var body = $(this).children('.body').html().replace(/<br\s*[\/]?>/gi, "\n");
|
||||
if ($(this).hasClass('thread')){
|
||||
var body = $(this).children('.post').children('.body').html().replace(/<br\s*[\/]?>/gi, "\n");
|
||||
} 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()});
|
||||
}
|
||||
if ($("div.post,div.thread").length > 1){
|
||||
|
|
Loading…
Reference in New Issue
Block a user