I wanted to close the navbar click outside of it then I used this code
$(document).on('click',function(){              
        if(!$('#top_right_menu_btn').hasClass('open')) {
            $('#myNavbar').collapse('hide');
        }
    });  
but it closes drop down menu even click on it, so I want to prevent from closing when clicking on it.
my site (nav bar will appear when screen size below 768px)
 
    