GithubHelp home page GithubHelp logo

Comments (4)

ddnexus avatar ddnexus commented on August 25, 2024 1

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.

espen avatar espen commented on August 25, 2024 1

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.

ddnexus avatar ddnexus commented on August 25, 2024

@espen What about this issue? It looks invalid to me, so it should be closed.

from pagy.

ddnexus avatar ddnexus commented on August 25, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.