-
Notifications
You must be signed in to change notification settings - Fork 60
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implements pagination with page numbers #12
Conversation
- Added icon support on next/previous buttons - Added a page_number mode, i.e., with buttons for each page - Included tests for the added features
Include simple instructions to use the paginator with page number buttons instead of "Page x of y"
Great job @israelss previous_button_icon 👍 |
I think that it's simpler and easier to use it that way, but on a second thought I agree that it should be included within E.g., with that
And with 13 pages in total, the result will be something like that (yes, i took that example from Foundation 6 pagination): I will change it to be passed through |
* page_numbers now has to be passed in options. It is false by default. * Icons always have priority over text, being default with page_numbers, but not without it. * Fix a small bug where data would always be fetched on button click, even when the page is the same. Now data will only be fetched when the page change.
++TESTS ARE NEEDED++ * Added the ellipsis support when the given number of pages are bigger than the maximum defined by the user
* Added some basic testing for the page numbers * changed default `max_buttons` from 5 to 7 * Tweaked some tests from utils.spec.js, and removed duplicate tests
** First commit with ellipsis (ae98586) * Added the ellipsis support when the given number of pages are bigger than the maximum defined by the user ** Included utils.js tests (bba6be1) ** Changes in tests && more ( 8b4756a) * Added some basic testing for the page numbers * changed default `max_buttons` from 5 to 7 * Tweaked some tests from utils.spec.js, and removed duplicate tests
* Included `ellipses` option (default: true), which can be used to turn on/off the ellipsis buttons creation * Limited the range which can be used in `max_buttons` option. Now has to be at least 1. * Added more tests
Ok, so ellipsis buttons are now available! 😃 A new option was created, Another new option is What are your thoughts on these changes, @hootlex? |
When will this be merged? I think it would be nice. Btw, is this support Vue 2? |
@nmfzone it works fine with Vue 2 👍 |
* Added the `page_button_text` option, which makes possible to have custom text before the number of page on the buttons. So instead of just ['1', '2', '3', etc] on the buttons, we can now have ['Page 1', 'Page 2', 'Page 3', etc] * Included some additional tests and refactored some old ones
One more addition, the |
Awesome work @israelss When it is done, do you plan on updating the documentation? |
|
@israelss I think I'm done. Check page-numbers branch and feel free to open a pr there if you want to make any changes. |
@israelss could I have an answer on 1? |
Sorry, I was off the net the last two weeks. Answering:
I can work on the docs. But I can only start it on next week, is that ok?
Is that random/unexpected? When it is happening? 😕
Thanks! 😃
I'll take a closer look tomorrow 👍 |
Hey @israelss, thanks for the quick update. Regarding the ellipses, I dont think it is a bug since you are displaying them intentionally.
Of course, it is okay. You can do it whenever you like to. I just need to know if you will do it. |
Is there any update for this? |
Hi. just wondering if this will be implemented? Thanks a lot. |
Yyyeah... is it happening? You guys don't seem to have been too active in the past 1.5 years :D. This is a good feature, so if anyone can finish the job it'd be awesome. |
As requested by @caiquecastro on #11.
Also, included two more options:
previous_button_icon
andnext_button_icon
.When using the pagination without
page_numbers
prop, the[previous|next]_button_text
will have priority over[previous|next]_button_icon
. Whenpage_numbers
istrue
, the icons have priority.But in any case, the user still can override icon or text by passing a value on
options
.The default icons are
glyphicon-chevron-left
andglyphicon-chevron-right
.I wrote some additional tests, but to be honest, until today I didn't have any experience with any kind of automatized tests, so if they are poorly written or if there are need for some more tests, please tell me!