v1.18.x
barisusakli 10 years ago
parent bbfec7d443
commit 200f74f1c7

@ -38,11 +38,15 @@ $(document).ready(function() {
app.previousUrl = url; app.previousUrl = url;
return ajaxify.go('login'); return ajaxify.go('login');
} else if (status === 302) { } else if (status === 302) {
if (data.responseJSON.path) {
if (!ajaxify.go(data.responseJSON.path, callback, quiet)) { if (!ajaxify.go(data.responseJSON.path, callback, quiet)) {
window.location.href = data.responseJSON.path; 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); app.alertError(data.responseJSON.error);
} }
} }

@ -76,9 +76,9 @@ define('forum/topic', [
Topic.toBottom = function() { Topic.toBottom = function() {
socket.emit('topics.postcount', ajaxify.variables.get('topic_id'), function(err, postCount) { socket.emit('topics.postcount', ajaxify.variables.get('topic_id'), function(err, postCount) {
if (config.topicPostSort !== 'oldest_to_newest') { if (config.topicPostSort !== 'oldest_to_newest') {
postCount = 1; postCount = 2;
} }
navigator.scrollBottom(postCount - 1); navigator.scrollBottom(postCount);
}); });
}; };

@ -137,7 +137,7 @@ define('navigator', ['forum/pagination'], function(pagination) {
if ($('li[data-index="' + index + '"]').length) { if ($('li[data-index="' + index + '"]').length) {
navigator.scrollToPost(index, true); navigator.scrollToPost(index, true);
} else { } else {
index = parseInt(index, 10) + 1; index = parseInt(index, 10);
ajaxify.go(generateUrl(index)); ajaxify.go(generateUrl(index));
} }
}; };

Loading…
Cancel
Save