mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-03 04:25:55 +01:00
merge
This commit is contained in:
@@ -12,7 +12,8 @@ define('forum/topic', [
|
||||
'navigator',
|
||||
'sort',
|
||||
'components',
|
||||
], function (infinitescroll, threadTools, postTools, events, posts, images, replies, navigator, sort, components) {
|
||||
'storage',
|
||||
], function (infinitescroll, threadTools, postTools, events, posts, images, replies, navigator, sort, components, storage) {
|
||||
var Topic = {};
|
||||
var currentUrl = '';
|
||||
|
||||
@@ -142,7 +143,7 @@ define('forum/topic', [
|
||||
|
||||
function handleBookmark(tid) {
|
||||
// use the user's bookmark data if available, fallback to local if available
|
||||
var bookmark = ajaxify.data.bookmark || localStorage.getItem('topic:' + tid + ':bookmark');
|
||||
var bookmark = ajaxify.data.bookmark || storage.getItem('topic:' + tid + ':bookmark');
|
||||
var postIndex = getPostIndex();
|
||||
|
||||
if (postIndex && window.location.search.indexOf('page=') === -1) {
|
||||
@@ -159,7 +160,7 @@ define('forum/topic', [
|
||||
navigator.scrollToIndex(parseInt(bookmark - 1, 10), true);
|
||||
},
|
||||
closefn: function () {
|
||||
localStorage.removeItem('topic:' + tid + ':bookmark');
|
||||
storage.removeItem('topic:' + tid + ':bookmark');
|
||||
},
|
||||
});
|
||||
setTimeout(function () {
|
||||
@@ -270,7 +271,7 @@ define('forum/topic', [
|
||||
|
||||
function updateUserBookmark(index) {
|
||||
var bookmarkKey = 'topic:' + ajaxify.data.tid + ':bookmark';
|
||||
var currentBookmark = ajaxify.data.bookmark || localStorage.getItem(bookmarkKey);
|
||||
var currentBookmark = ajaxify.data.bookmark || storage.getItem(bookmarkKey);
|
||||
|
||||
if (ajaxify.data.postcount > ajaxify.data.bookmarkThreshold && (!currentBookmark || parseInt(index, 10) > parseInt(currentBookmark, 10))) {
|
||||
if (app.user.uid) {
|
||||
@@ -284,7 +285,7 @@ define('forum/topic', [
|
||||
ajaxify.data.bookmark = index;
|
||||
});
|
||||
} else {
|
||||
localStorage.setItem(bookmarkKey, index);
|
||||
storage.setItem(bookmarkKey, index);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user