Using timbles to add pagination by default to an existing project based on Pure, I came across a need to have a class added to all the buttons generated for pagination. What I ended up adding was a simple .addClass('pure-button') to places where buttons were generated.
However, I think this can be easily generalized. Adding an entry to the classes object with a default null, and a .toggleClass( paginationButton, paginationButton ) call to button creation. This adds the class only when it's present (technically truthy but given string inputs or nothing, these end up the same).
Would something like this be a meaningful addition? Code impact is a handful lines, and execution is affected only when adding the buttons to the DOM which happens once per table at most.
Using timbles to add pagination by default to an existing project based on Pure, I came across a need to have a class added to all the buttons generated for pagination. What I ended up adding was a simple
.addClass('pure-button')
to places where buttons were generated.However, I think this can be easily generalized. Adding an entry to the
classes
object with a default null, and a.toggleClass( paginationButton, paginationButton )
call to button creation. This adds the class only when it's present (technically truthy but given string inputs or nothing, these end up the same).Would something like this be a meaningful addition? Code impact is a handful lines, and execution is affected only when adding the buttons to the DOM which happens once per table at most.