mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-28 01:26:16 +01:00
fix: #11451 , use bookmark from localstorage for guests
This commit is contained in:
@@ -1,6 +1,8 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
define('navigator', ['forum/pagination', 'components', 'hooks', 'alerts', 'translator'], function (pagination, components, hooks, alerts, translator) {
|
define('navigator', [
|
||||||
|
'forum/pagination', 'components', 'hooks', 'alerts', 'translator', 'storage',
|
||||||
|
], function (pagination, components, hooks, alerts, translator, storage) {
|
||||||
const navigator = {};
|
const navigator = {};
|
||||||
let index = 0;
|
let index = 0;
|
||||||
let count = 0;
|
let count = 0;
|
||||||
@@ -354,8 +356,8 @@ define('navigator', ['forum/pagination', 'components', 'hooks', 'alerts', 'trans
|
|||||||
if (!paginationBlockUnreadEl.length || ajaxify.data.postcount <= ajaxify.data.bookmarkThreshold) {
|
if (!paginationBlockUnreadEl.length || ajaxify.data.postcount <= ajaxify.data.bookmarkThreshold) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
const currentBookmark = ajaxify.data.bookmark || storage.getItem('topic:' + ajaxify.data.tid + ':bookmark');
|
||||||
index = Math.max(index, Math.min(ajaxify.data.bookmark, ajaxify.data.postcount));
|
index = Math.max(index, Math.min(currentBookmark, ajaxify.data.postcount));
|
||||||
const unreadEl = paginationBlockUnreadEl.get(0);
|
const unreadEl = paginationBlockUnreadEl.get(0);
|
||||||
const trackEl = unreadEl.parentNode;
|
const trackEl = unreadEl.parentNode;
|
||||||
const trackHeight = trackEl.getBoundingClientRect().height;
|
const trackHeight = trackEl.getBoundingClientRect().height;
|
||||||
|
|||||||
Reference in New Issue
Block a user