angularUtils icon indicating copy to clipboard operation
angularUtils copied to clipboard

Pagination: Ellipses in pager should navigate to the page preceding/following the displayed range.

Open patrickbgates opened this issue 10 years ago • 1 comments

Unless I'm mistaken, the ellipses generated by dir-paginate don't do anything. It would be handy if the out-of-the-box behavior was for those to navigate to the page immediately preceding/following the displayed range.

Example: In the screenshot below, the left ellipsis would navigate to page 6, and the right ellipsis would navigate to page 11.

dirpaginate_ellipses

patrickbgates avatar Nov 19 '15 03:11 patrickbgates

Yes, you're right that they don't currently do anything.

And I also agree that it would be better if they did behave as you describe. I think it should be simple to do this so I'll have a go at implementing it now.

Update: Whoa - actually it turns out to be not so simple. It involves modifying the setCurrent(num) method in the dirPaginationControlsLinkFn. However, it is only designed to be provided with a number, and in the case of "..." it does nothing.

We'd need some way to let that method know which ellipses this is, and what page to go to as a result. I'd like to somehow be able to do that without changing the API of setCurrent if possible.

What this means is that I will not have time to work on this now as it will take longer than first expected.

Someone else is very welcome to give it a shot and put in a pull request or just advice on how they did it.

I'll mark it to work on the next time I get a bit more time for this.

michaelbromley avatar Nov 20 '15 08:11 michaelbromley