Add event handler to close context menu from touching outside the menu. Improves user experience on touch devices. Closes #2258.