thefantas / jquery-ui-tabs-paging

Automatically exported from code.google.com/p/jquery-ui-tabs-paging
0 stars 0 forks source link

Cycle false not working when going to the right #5

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Set Cycle to False
2. Keep hitting right arrow
3.

What is the expected output? What do you see instead?
Should stop on last page. Got cycling

What version of the product are you using? On what operating system?

Please provide any additional information below.

changed function page(direction) 

if ((direction == 'prev' && currentPage < 0 && opts.cycle) || (direction ==
'next' && currentPage >= pages.length && !opts.cycle))
                currentPage = pages.length - 1;
            else if ((direction == 'prev' && currentPage < 0) || 
                     (direction == 'next' && currentPage >= pages.length && opts.cycle))
                currentPage = 0;

there was an error in your logic. that is the fix.

Original issue reported on code.google.com by ode...@gmail.com on 12 Nov 2009 at 9:16

GoogleCodeExporter commented 9 years ago
Thanks for your comments.  I have added this code to the latest version.  
However,
this line should have disabled the button to prevent the button from even being
disabled...

   if (!opts.cycle && end >= self.length()) disableButton('next');

In any case, I added the logic so that if your "ui-tabs-paging-disabled" class 
is not
defined to hide the button, it will still not attempt to do the paging.

Thanks again.

Original comment by brian.se...@gmail.com on 15 Nov 2009 at 2:57