Join GitHub today
add a hasClass() method #1464
Two goals here:
First, the removeClass() wasn't adding spaces before and after element.className and the class. This could create weird false positives as we get into compound class names, like vjs-fluid, and vjs-fluid-4-3. This aligns the check across both methods.
Second, I think hasClass is going to be essential for testing, going forward.
I could also rewrite some of the older tests to use hasClass(), too. The older tests incorrectly match a substring, e.g.
but I think this works now as is.