zurb/foundation — pull request #1070 by jvivs (2012-10-25 23:47:25+00:00)
Title: Add option to toggle dropdown buttons

Option can be enabled like this:

```javascript
$(document).foundationButtons({dropdownAsToggle: true});
```

When enabled, dropdown and split buttons will act as toggles to open and close their dropdowns. Dropdowns in buttons that are already open will be closed when a new dropdown is toggled.

When dropdown toggling is enabled, an active class will be added to the toggling element (.button.dropdown or .button.dropdown.split > span) to provide styling hooks for the active state. This class is configurable, but defaults to .active.

I can contribute styles for active class as well if desired... held off to keep this PR small for now.

The three click handlers are consolidated to one to ease implementation of toggling and simplify event model.

The use of e.stopPropagation has been replaced with a check against the event's original target. It plays nicer with other poolled events.