improvement for getting correct submenu's height

added an option to set submenu's max height so it gets the correct
height, rather than always using menu's height (in some cases, menu's
height is less than submenu's);
added leaveMenuTimeoutId, for not deactivating submenu if mouse is
moving to submenu but has exited menu.