bradvin/FooTable — pull request #131 by akf (2013-08-29 22:20:23+00:00)
Title: Added ability to override the toggler with other HTML markup.

Hello again,

This is potentially more controversial than my last pull request. :-) The change is small, but I may very well be missing an easier or more idiomatic way of achieving my goal. Hopefully the demo explains how to use it; here's why I'm proposing this:

The goal is to enable customization of the toggle control beyond what can be accomplished with CSS. We've been using FooTable 0.5, with the default plus and minus background images. I was asked to add text for accessibility. (I haven't actually seen how screen readers handle FooTables, but I'm reading between the lines that it's possible to have columns hidden in that scenario, and that the expand/contract option became unavailable).

This is the solution I came up with. It's a pretty limited change to footable.js that does leave a lot to the imagination for the web developer. In the demo, I use the old plus/minus images, but what we're probably going to use in production is an icon (font) with "Show Details"/"Hide Details" text in a span that is visually hidden but available to screen readers.

By the way, I started poking at this a couple of weeks ago on the 0.5 release. I found the V2 code cleaner and easier to follow -- nice work!

Thanks for taking a look.