jennschiffer / timbles.js

a very simple jQuery plugin for tables, made by the person who literally did not invent tables
MIT License
38 stars 4 forks source link

Add class hint to pagination buttons #29

Closed edelooff closed 8 years ago

edelooff commented 8 years ago

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.

edelooff commented 8 years ago

This has been added in #33.