Add submenuopen, submenuclose callbacks to UI Menu
Because of 300 ms delay there's no good way of determining when submenu is being open. Adding submenuopen (opensubmenu, simply open?) callback at the end of anonymous function in _startOpening() would do the job. Probably like this:
this._trigger( "submenuopen", event, { item: submenu } );
And for consistency, in _close():
var that = this,
cachedMenus = startMenu
.find( ".ui-menu[aria-expanded=true]" );
startMenu
(...)
.removeClass( "ui-state-active" );
cachedMenus.each ( function () {
that._trigger( "submenuclose", event, { item: this } );
});