mirror of
https://github.com/phpbb/phpbb.git
synced 2025-07-31 22:10:45 +02:00
Changed jumpto() JS function to be more fail-safe. (But #27635 - patch by peterkclee)
git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@9466 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
@@ -28,9 +28,16 @@ function jumpto()
|
||||
{
|
||||
var page = prompt(jump_page, on_page);
|
||||
|
||||
if (page !== null && !isNaN(page) && page > 0)
|
||||
if (page !== null && !isNaN(page) && page == Math.floor(page) && page > 0)
|
||||
{
|
||||
document.location.href = base_url.replace(/&/g, '&') + '&start=' + ((page - 1) * per_page);
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -39,9 +39,16 @@ function jumpto()
|
||||
{
|
||||
var page = prompt(jump_page, on_page);
|
||||
|
||||
if (page !== null && !isNaN(page) && page > 0)
|
||||
if (page !== null && !isNaN(page) && page == Math.floor(page) && page > 0)
|
||||
{
|
||||
document.location.href = base_url.replace(/&/g, '&') + '&start=' + ((page - 1) * per_page);
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user