Check ancestors when button is clicked

In Chrome, if a user clicks on a `<button>` with child elements, the click target is the child element and not the `<button>` (if the user clicked precisely on the child element). See http://jsfiddle.net/jefferyto/MDCHj/ for a demo (try clicking on both the green `<button>` as well as the red inner `<i>` element).

This change checks the click target as well as its ancestors, when testing for classes. (A demo with this change is at http://jsfiddle.net/jefferyto/Jdg4E/2/)