I ended using this code, once the dropdown is closed no more events run.
$('.header-top-bar .toggle').on('click', function (event) {
event.preventDefault();
var $this = $(this),
$content = $this.next('.toggle-content');
if (!$content.hasClass('isOpen')) {
$content.addClass('isOpen');
setTimeout(function () {
$document.on('click.headerToggle', function (event) {
if (!$(event.target).closest($content).length) {
$content.removeClass('isOpen');
$document.off('click.headerToggle');
}
});
}, 10);
}
});
Thank you all for your help.