mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-07 06:25:50 +01:00
remember where the topic was left off
This commit is contained in:
@@ -287,7 +287,6 @@ var socket,
|
|||||||
$('span.timeago').timeago();
|
$('span.timeago').timeago();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
setTimeout(function() {
|
setTimeout(function() {
|
||||||
window.scrollTo(0, 1); // rehide address bar on mobile after page load completes.
|
window.scrollTo(0, 1); // rehide address bar on mobile after page load completes.
|
||||||
}, 100);
|
}, 100);
|
||||||
@@ -435,9 +434,6 @@ var socket,
|
|||||||
input.val('');
|
input.val('');
|
||||||
return false;
|
return false;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
showWelcomeMessage = location.href.indexOf('loggedin') !== -1;
|
showWelcomeMessage = location.href.indexOf('loggedin') !== -1;
|
||||||
|
|||||||
@@ -223,6 +223,15 @@
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
var bookmark = localStorage.getItem('topic:' + tid + ':bookmark');
|
||||||
|
|
||||||
|
if(bookmark) {
|
||||||
|
// need to find out why it doesnt work without setTimeout -baris
|
||||||
|
setTimeout(function() {
|
||||||
|
app.scrollToPost(parseInt(bookmark, 10));
|
||||||
|
}, 300);
|
||||||
|
}
|
||||||
|
|
||||||
$('#post-container').on('click', '.deleted', function(ev) {
|
$('#post-container').on('click', '.deleted', function(ev) {
|
||||||
$(this).toggleClass('deleted-expanded');
|
$(this).toggleClass('deleted-expanded');
|
||||||
});
|
});
|
||||||
@@ -659,6 +668,7 @@
|
|||||||
var scrollBottom = scrollTop + windowHeight;
|
var scrollBottom = scrollTop + windowHeight;
|
||||||
|
|
||||||
if (scrollTop < 50 && postcount > 1) {
|
if (scrollTop < 50 && postcount > 1) {
|
||||||
|
localStorage.removeItem("topic:" + tid + ":bookmark");
|
||||||
postAuthorImage.src = (jQuery('.main-post .avatar img').attr('src'));
|
postAuthorImage.src = (jQuery('.main-post .avatar img').attr('src'));
|
||||||
mobileAuthorOverlay.innerHTML = 'Posted by ' + jQuery('.main-post').attr('data-username') + ', ' + jQuery('.main-post').find('.relativeTimeAgo').html();
|
mobileAuthorOverlay.innerHTML = 'Posted by ' + jQuery('.main-post').attr('data-username') + ', ' + jQuery('.main-post').find('.relativeTimeAgo').html();
|
||||||
pagination.innerHTML = '0 out of ' + postcount;
|
pagination.innerHTML = '0 out of ' + postcount;
|
||||||
@@ -666,7 +676,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
var count = 0;
|
var count = 0, smallestNonNegative = 0;
|
||||||
|
|
||||||
jQuery('.sub-posts').each(function() {
|
jQuery('.sub-posts').each(function() {
|
||||||
count++;
|
count++;
|
||||||
@@ -682,6 +692,11 @@
|
|||||||
|
|
||||||
|
|
||||||
if (inView) {
|
if (inView) {
|
||||||
|
if(elTop - scrollTop > smallestNonNegative) {
|
||||||
|
localStorage.setItem("topic:" + tid + ":bookmark", el.attr('data-pid'));
|
||||||
|
smallestNonNegative = Number.MAX_VALUE;
|
||||||
|
}
|
||||||
|
|
||||||
pagination.innerHTML = this.postnumber + ' out of ' + postcount;
|
pagination.innerHTML = this.postnumber + ' out of ' + postcount;
|
||||||
postAuthorImage.src = (jQuery(this).find('.profile-image-block img').attr('src'));
|
postAuthorImage.src = (jQuery(this).find('.profile-image-block img').attr('src'));
|
||||||
mobileAuthorOverlay.innerHTML = 'Posted by ' + jQuery(this).attr('data-username') + ', ' + jQuery(this).find('.relativeTimeAgo').html();
|
mobileAuthorOverlay.innerHTML = 'Posted by ' + jQuery(this).attr('data-username') + ', ' + jQuery(this).find('.relativeTimeAgo').html();
|
||||||
|
|||||||
Reference in New Issue
Block a user