agrublev / vanitytools

Automatically exported from code.google.com/p/vanitytools
0 stars 0 forks source link

jPaginte, clicking on a number (goto) gives wrong end calculation in paginationCalculator. #7

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
When having a lot op pages (pagination) but a limited nav_items,
the pagination calculation works not like expected, end calculation is wrong.

Reason: the current value passed from a goto call into the paginationCalculator 
is a string not a number.

            // handle click on pagination 
            $(".goto").live("click", function(e){
                e.preventDefault();
                set_cookie( "current", $(this).attr("title"));
                showPage($(this).attr("title"));
                $(".pagination").remove();
       ---->    createPagination($(this).attr("title"));
                $.scrollTo(120,{duration:500});
            });

This solved the problem

function paginationCalculator(curr)  
{
var current = parseInt(curr);

Original issue reported on code.google.com by koen.cae...@gmail.com on 12 Oct 2012 at 2:41