[ticket/11805] Fix "jump to page" feature for pagination in routes

PHPBB3-11805
This commit is contained in:
Joas Schilling 2013-08-22 14:36:22 +02:00
parent 0abb4a5ad3
commit f16a7e351f

View file

@ -40,10 +40,14 @@ function jumpto(item) {
page = prompt(jump_page, on_page);
if (page !== null && !isNaN(page) && page == Math.floor(page) && page > 0) {
if (base_url.indexOf('?') === -1) {
document.location.href = base_url + '?start=' + ((page - 1) * per_page);
if (base_url.indexOf('%d') === -1) {
if (base_url.indexOf('?') === -1) {
document.location.href = base_url + '?start=' + ((page - 1) * per_page);
} else {
document.location.href = base_url.replace(/&/g, '&') + '&start=' + ((page - 1) * per_page);
}
} else {
document.location.href = base_url.replace(/&/g, '&') + '&start=' + ((page - 1) * per_page);
document.location.href = base_url.replace('%d', page);
}
}
}