Browse Source

Use stored title instead of document.title in notifications

Prevents number of unreads being added to notification thread name
main
discomrade 3 years ago
parent
commit
5fb6acf047
  1. 2
      js/auto-reload.js
  2. 2
      js/mod/recent-posts-auto-reload.js

2
js/auto-reload.js

@ -159,7 +159,7 @@ $(document).ready(function(){
}
if (notify === "all" || (notify === "mention" && $(this).find('.own_post').length)) {
var body = $(this).children('.body').html().replace(/<br\s*[\/]?>/gi, "\n");
var n = new Notification("New reply to "+$('title').text(), {body: $('<div/>').html(body).text()});
var n = new Notification("New reply to "+ title, {body: $('<div/>').html(body).text()});
}
>>>>>>> 5e4e27bc... Make all notifications show, not just the first unread

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

@ -192,7 +192,7 @@ $(document).ready(function(){
if($('#' + id).length == 0) {
if (notify) {
var body = $(this).children('.body').html().replace(/<br\s*[\/]?>/gi, "\n");
var n = new Notification("New reply to "+$('title').text(), {body: $('<div/>').html(body).text()});
var n = new Notification("New reply to "+ title, {body: $('<div/>').html(body).text()});
}
$(this).parent().insertBefore($('.post-wrapper:first'));
new_posts++;

Loading…
Cancel
Save