twbs/bootstrap — pull request #11048 by YodasWs (2013-10-11 23:54:20+00:00)
Title: Enable Close Dropdown on Toggle Click

In Chrome with Zepto, clicking on the dropdown toggle button when the dropdown was open would not close the dropdown. This appears to be because click.bs.dropdown.data-api fires on the document first to call clearMenus(), making Dropdown.prototype.toggle see a closed dropdown to open again.

This update replaces Dropdown.prototype.toggle's call to clearMenus with its own code. clearMenus also needs to be escaped if the event target is the dropdown toggle button.