Skip to content

Node.js based forum software built for the modern web

feat: add row highlighting for popular and unread

psychobunny2cd5f959a0d2
diff --git a/public/src/client/topic/threadTools.js b/public/src/client/topic/threadTools.js
index 646438df41..9eebc5919c 100644
--- a/public/src/client/topic/threadTools.js
+++ b/public/src/client/topic/threadTools.js
@@ -53,7 +53,9 @@ define('forum/topic/threadTools', [
}
if (app.previousUrl && !app.previousUrl.match('^/topic')) {
- ajaxify.go(app.previousUrl, handleBack.onBackClicked);
+ ajaxify.go(app.previousUrl, function () {
+ handleBack.onBackClicked(true);
+ });
} else if (ajaxify.data.category) {
ajaxify.go('category/' + ajaxify.data.category.slug, handleBack.onBackClicked);
}
diff --git a/public/src/modules/handleBack.js b/public/src/modules/handleBack.js
index 3de96cb414..ea69798d28 100644
--- a/public/src/modules/handleBack.js
+++ b/public/src/modules/handleBack.js
@@ -32,8 +32,9 @@ define('handleBack', [
});
}
- function onBackClicked() {
- if ((ajaxify.data.template.category || ajaxify.data.template.recent)) {
+ function onBackClicked(isMarkedUnread) {
+ var highlightUnread = isMarkedUnread && ajaxify.data.template.unread;
+ if (ajaxify.data.template.category || ajaxify.data.template.recent || ajaxify.data.template.popular || highlightUnread) {
var bookmarkIndex = storage.getItem('category:bookmark');
var clickedIndex = storage.getItem('category:bookmark:clicked');