feat: add row highlighting for popular and unread

v1.18.x
psychobunny 4 years ago
parent 48a8ec4ab2
commit 2cd5f959a0

@ -53,7 +53,9 @@ define('forum/topic/threadTools', [
} }
if (app.previousUrl && !app.previousUrl.match('^/topic')) { 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) { } else if (ajaxify.data.category) {
ajaxify.go('category/' + ajaxify.data.category.slug, handleBack.onBackClicked); ajaxify.go('category/' + ajaxify.data.category.slug, handleBack.onBackClicked);
} }

@ -32,8 +32,9 @@ define('handleBack', [
}); });
} }
function onBackClicked() { function onBackClicked(isMarkedUnread) {
if ((ajaxify.data.template.category || ajaxify.data.template.recent)) { 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 bookmarkIndex = storage.getItem('category:bookmark');
var clickedIndex = storage.getItem('category:bookmark:clicked'); var clickedIndex = storage.getItem('category:bookmark:clicked');

Loading…
Cancel
Save