Skip to content

Node.js based forum software built for the modern web

closes #2592

barisusakli200f74f1c7f5
diff --git a/public/src/ajaxify.js b/public/src/ajaxify.js
index e6cce7a920..cc7c0cbff1 100644
--- a/public/src/ajaxify.js
+++ b/public/src/ajaxify.js
@@ -38,11 +38,15 @@ $(document).ready(function() {
app.previousUrl = url;
return ajaxify.go('login');
} else if (status === 302) {
- if (!ajaxify.go(data.responseJSON.path, callback, quiet)) {
- window.location.href = data.responseJSON.path;
+ if (data.responseJSON.path) {
+ if (!ajaxify.go(data.responseJSON.path, callback, quiet)) {
+ window.location.href = data.responseJSON.path;
+ }
+ } else if (data.responseJSON) {
+ ajaxify.go(data.responseJSON.slice(1), callback, quiet);
}
}
- } else if (textStatus !== "abort") {
+ } else if (textStatus !== 'abort') {
app.alertError(data.responseJSON.error);
}
}
diff --git a/public/src/client/topic.js b/public/src/client/topic.js
index 1d5e16ce7e..40c1a84e13 100644
--- a/public/src/client/topic.js
+++ b/public/src/client/topic.js
@@ -76,9 +76,9 @@ define('forum/topic', [
Topic.toBottom = function() {
socket.emit('topics.postcount', ajaxify.variables.get('topic_id'), function(err, postCount) {
if (config.topicPostSort !== 'oldest_to_newest') {
- postCount = 1;
+ postCount = 2;
}
- navigator.scrollBottom(postCount - 1);
+ navigator.scrollBottom(postCount);
});
};
diff --git a/public/src/modules/navigator.js b/public/src/modules/navigator.js
index b35a06c666..43b355ccf8 100644
--- a/public/src/modules/navigator.js
+++ b/public/src/modules/navigator.js
@@ -137,7 +137,7 @@ define('navigator', ['forum/pagination'], function(pagination) {
if ($('li[data-index="' + index + '"]').length) {
navigator.scrollToPost(index, true);
} else {
- index = parseInt(index, 10) + 1;
+ index = parseInt(index, 10);
ajaxify.go(generateUrl(index));
}
};