| 
		
			Сообщение от Angelinasen
			
		
	 | 
	| 
		Если вопрос по jQuery, сюда же писать?
	 | 
	
нет это уже к теме управления клавишами не относится, для это есть раздел 
https://javascript.ru/forum/jquery/
но можно и тут ...
$(function() {
    const menu = ('.profile-top-header__menu');
    $('.profile-top-header').click(function(event) {
        event.preventDefault();
        menu.toggleClass('active');
    });
    $(document).click(function(event) {
        if ($(event.target).closest('.profile-top-header__menu, .profile-top-header').length) return;
        menu.removeClass('active')
    });
});