Skip to content
This repository has been archived by the owner on May 29, 2019. It is now read-only.

Add first & last buttons in pagination. #159

Closed
wants to merge 4 commits into from
Closed

Add first & last buttons in pagination. #159

wants to merge 4 commits into from

Conversation

bekos
Copy link
Contributor

@bekos bekos commented Feb 19, 2013

Added optional buttons in pagination directive to quickly move to first and last page.

The attribute to display or not these buttons is boundary. Also there is a chance to change the default labels First and Last by defining first-text and last-text.

Signed-off-by: tbekos <tbekos@gmail.com>
Signed-off-by: tbekos <tbekos@gmail.com>
@petebacondarwin
Copy link
Member

Looks OK to me. Should the text options, like first-text, etc. be configurable in a config constant?

@ajoslin
Copy link
Contributor

ajoslin commented Feb 19, 2013

👍, looks good @bekos! This is a good time to add the config constant as Pete said.

@bekos if you want to check out how the config constant is added in another directive, see buttons.js for an example.

 * Added paginationConfig constant.
 * Added tests for configuration parameters.

Signed-off-by: tbekos <tbekos@gmail.com>
@bekos
Copy link
Contributor Author

bekos commented Feb 20, 2013

Added configuration options in constant and the appropriate tests.

@pkozlowski-opensource
Copy link
Member

@bekos Thnx for working on this pagination thing.

I was trying to merge it today but I've noticed that it doesn't work correctly in the first & last options are not enabled. The reason for this is that Bootstrap is using pseudo-class selectors (.pagination ul > li:first-child) to have rounded corners for the first-last item. Simply hiding those items breaks things as those CSS rules are applied to hidden elements.

I'm not sure what is the best solution for this problem atm so it will require some more thinking and work.

Going to close this PR for now as it requires further work. Please open another one when you've got a better idea of sorting this out.

@bekos
Copy link
Contributor Author

bekos commented Feb 25, 2013

@pkozlowski-opensource You are right. I didn't notice it because in my application I always use first & last buttons!
I could use ng-switch on first & last li elements when boundary is true, in order to remove their elements instead of hiding them, but there is still a bug in AngularJS that prevents me. angular/angular.js#1074

Btw, why ui-if from AngularUI is not part of the core application, as ng-if?

@petebacondarwin
Copy link
Member

unit tests, unit tests, unit tests, ... :-)

On 25 February 2013 08:25, Tasos Bekos notifications@github.com wrote:

@pkozlowski-opensource https://github.com/pkozlowski-opensource You are
right. I didn't notice it because in my application I always use first &
last buttons!
I could use ng-switch on first & last li elements when boundary is true,
in order to remove their elements instead of hiding them, but there is
still a bug in AngularJS that prevents me. angular/angular.js#1074angular/angular.js#1074

Btw, why ui-if from AngularUI is not part of the core application, as
ng-if?


Reply to this email directly or view it on GitHubhttps://github.com//pull/159#issuecomment-14030263.

@pkozlowski-opensource
Copy link
Member

Well, this one was CSS really :-) So not sure how to write a test for this...

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants