adobe/brackets — pull request #4187 by redmunds (2013-06-11 00:41:51+00:00)
Title: Popup management

This requires brackets-shell branch randy/menu-open-event

This pull request is for: #1518, #2897, #3426 (when using menu)

More generically, this should cause any popup to get dismissed when any other popup is invoked, where the current list of popups are:
* menus
* context menus
* recent project list
* code hints

A registerContextMenu method was added to PopUpManager because ContextMenus are created in AppInit.htmlReady callback, so they may or may not be created when PopUpManager is defining event handlers.

I'm not sure how to test in-browser menus -- probably needs to trigger beforeMenuPopup event.

This implements message APP_BEFORE_MENUPOPUP to get called from brackets-shell, which triggers beforeMenuPopup event. The Mac solution is kinda clunky because it sends message multiple times when menu pops up, and also when command is executed via shortcut key.