jsymonkj / pwi

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

pagination calculation bug - albumMaxResults & albumsPerPage options not work correctly together... #90

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
1. edit demo1.html and edit as follows

2.  $("#container").pwi({
           username: 'jdiderik',
           albumMaxResults: 5,
           albumsPerPage: 2
     });

We expect a total of 5 albums; 2 album per page; and a total of 3 pages.

What we got is 4 pages, last page says "No albums available"/undefined

pagination calculation bug - albumMaxResults & albumsPerPage options not work 
correctly together...

Tested with: pwi 1.4.0, pwi 1.5.0, Internet Explorer, Mozilla Firefox, Windows 
xp

Original issue reported on code.google.com by volka...@gmail.com on 4 Oct 2011 at 12:16

GoogleCodeExporter commented 9 years ago
This is indeed a problem. The pager is using the total of albums available 
albums instead of the number of shown albums.

Original comment by borkh...@gmail.com on 23 Oct 2011 at 5:35

GoogleCodeExporter commented 9 years ago
Fixed in SVN version 207. In jquery.pwi.js, change line 184:

            $na = j.feed.entry.length;

into

            $na = j.feed.entry.length;
            if ($na > settings.albumMaxResults) {
                $na = settings.albumMaxResults;
            }

Minified version attached.

Original comment by borkh...@gmail.com on 4 Nov 2011 at 11:11

Attachments: