Comments (4)
It is possible.
The links have an extra disabled
class "when there is no page to go to", so you can pick and hide them with a display: none;
CSS rule.
from pagy.
Well I disagree with you but feel free to close it 😅
I think the helper should be responsible for this. Not only more convenient when implementing but I think it's the right place to handle it. The helper is responsible for the visual output. If there is no need to show it then I think it should be up to the helper to decide it, at least for generic things like this. But it's not a big thing to implement in the view so it's not a huge hassle the way it is now. Another thing to note; I migrated from kaminari so first I followed the readme and replacing the view helper. Worked great. Then going through testing I noticed this problem and I assumed it would work as kaminari or at least give a global option to control it. As it didn't I had to replace the 10 or so helper calls with extra code. Again, not a big thing, but it would be smoother and easier to migrate with this option. But again: up to you and I respect your decision. I understand you want to keep the gem small and focused, which is a good way of looking at things.
from pagy.
@espen What about this issue? It looks invalid to me, so it should be closed.
from pagy.
Thank you for your feedback! I understand your point, and it makes sense, however it clashes with 2 things: performance and code simplicity, which have the highest priority in Pagy.
The consequence of that priorities is a big part of the reason you enjoy a super-fast and light pagination (and I guess one of the reasons you migrated from Kaminari :))
Replacing the helper calls with extra code instead of adding one singe imple CSS rule costs you some IPS, some simplicity and probably some little memory: you decide if it is worth in your own code. Including it in the Pagy code would impose the cost (albeit small [*]) on every user, even if they don't need the option or even if they would prefer CSS to remove it.
[*] the performance of Pagy are made possible thanks to many very little choices like that one
from pagy.
Related Issues (20)
- Bug: Alias for an aggregate result is removed HOT 9
- Bug: Issue with Arel scope passed to pagy method HOT 3
- Docs: 7.0 has an undocumented breaking change for active page styling HOT 5
- Docs: Which branch should PRs be made against? HOT 3
- Docs: Update performance metrics HOT 5
- Trim doesn't call with pagy_nav_js when first page is active
- Bug: Adapt with Mongoid add extention HOT 1
- Bug: Pagy::Backend#pagy_get_vars `count_args` gets ignored HOT 3
- Docs: https://ddnexus.github.io/pagy/quick-start/#configure HOT 1
- Bug: Missing initializer in documentation HOT 1
- Bug: wrong number of arguments (given 2, expected 0) HOT 2
- Bug: wrong number of arguments (given 2, expected 0) HOT 1
- Bug: Pagy not working with Geocoder gem
- Bug: Undocumented backwards-incompatible change of empty "page" parameter introduced in 6.4.0 HOT 3
- Docs: lost section about wrap existing pagination with pagy_calendar HOT 1
- Bug: Request for Pagy Gem: Making Commands Platform Independent HOT 1
- Bug: Pagy 8.4.0 is broken with MS SQL server HOT 18
- Bug: Only Limit 1 Query HOT 3
- Documentation: `anchor_string` option in `pagy_bootstrap_nav` (example from documentation) doesn't appear to be working HOT 1
- Docs: Some improvements in the documentation
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pagy.