<script type="text/javascript">
$(document).ready(function() {
$(document).on('click', '.dropdown-menu', function (e) {
$(this).hasClass('keep_open') && e.stopPropagation(); // This replace if conditional.
});
});
</script>