component/classes — pull request #14 by dominicbarnes (2013-09-25 23:06:40+00:00)
Title: Adding support to toggle for the force parameter

I've added support to the `#toggle()` method for the `force` parameter.

This feature is outlined in the [DOMTokenList specification](http://dom.spec.whatwg.org/#dom-domtokenlist-toggle) as well as being a part of other popular libraries like jQuery. I understand this component is *not* a `classList` polyfill, I'm only mentioning to show that it is implemented elsewhere and has usefulness.

In any case, there is a caveat that I have accounted for. Some browsers support `classList` natively, but not the `force` parameter. (in my tests, this only happened in Safari) In these browsers, the `force` parameter is not acknowledged and a normal toggle takes place. I detect that anomaly and correct it, so this passes in all browsers I've tested:

* Windows (XP and Vista)
* IE8 and IE9 (respectively)
* Chrome
* Safari
* Linux (Ubuntu)
* Chrome
* Firefox