This commit is contained in:
barisusakli
2014-03-09 16:39:31 -04:00
parent 281c482f1c
commit 57f9f8bc57
2 changed files with 4 additions and 5 deletions

View File

@@ -309,7 +309,7 @@ define(['composer', 'forum/pagination'], function(composer, pagination) {
var bookmark = localStorage.getItem('topic:' + tid + ':bookmark');
if (window.location.hash) {
Topic.scrollToPost(window.location.hash.substr(1), true);
} else if (bookmark && (!config.usePagination || (config.usePagination && pagination.currentPage === 1))) {
} else if (bookmark && (!config.usePagination || (config.usePagination && pagination.currentPage === 1)) && Topic.postCount > 1) {
app.alert({
alert_id: 'bookmark',
message: '[[topic:bookmark_instructions]]',
@@ -1042,8 +1042,9 @@ define(['composer', 'forum/pagination'], function(composer, pagination) {
$('.progress-bar').width((index / Topic.postCount * 100) + '%');
var currentBookmark = localStorage.getItem('topic:' + templates.get('topic_id') + ':bookmark');
if (!currentBookmark || parseInt(el.attr('data-pid'), 10) > parseInt(currentBookmark, 10)) {
if (!currentBookmark || parseInt(el.attr('data-pid'), 10) >= parseInt(currentBookmark, 10)) {
localStorage.setItem('topic:' + templates.get('topic_id') + ':bookmark', el.attr('data-pid'));
app.removeAlert('bookmark');
}
if (!scrollingToPost) {