Robdel12/DropKick — pull request #137 by dgillis (2013-08-13 14:59:08+00:00)
Title: Ensure dropdowns closed when external clicks are made.

Hi, thanks for managing this useful plugin. I've found a couple circumstances where dropdowns incorrectly remain open even when the document is clicked outside of them. The changes should address them.

1) Since line 384 prevents the event from bubbling, when a document click is made with any .dk_container, the event handler on line 430 will not be invoked and thus clicking on while DK dropdown while another is still open does not close the other one, as you would expect. The code on line 379 addresses this.

2) The commented out code on line 436 is incorrect; if any DK dropdown other than the first is open, it will remain open no matter where you click on the document. You should just close them all (as per the edit) since the desired behaviour is to close ALL of them in this case regardless.