xsokev/Dojo-Bootstrap — pull request #36 by hamishcampbell (2013-01-10 22:40:46+00:00)
Title: Fix dropdowns not closing on clicking the dropdown toggle.

The cause of the bug is the way we listen to events. The toggle method
is listened for on the document body, and the global menu clearer
is attached to the document body. This causes `clearMenus` to be
called before the toggle event, so the menu is always kept open.

This fix applies an event listened to the document, listening on the
document body for a global `click` event. This allows the event to be
correctly cancelled by `toggle`, which stops event propagation and
prevents a second `clearMenu` call.