title: Bootstrap dropdown menu: not close when click outside the menu
body: <p>I'm using this script to control open/collapse menu items:</p>
  
  <pre><code>$('.dropdown').on({
      "click": function(event) {
          if ($(event.target).closest('.dropdown-toggle').length &amp;&amp; $(this).parents('.dropdown').length === ($(event.target).parents('.dropdown').length - 1)) {
              $(this).data('closable', true);
          } else {
              $(this).data('closable', false);
          }
      },
      "hide.bs.dropdown": function(event) {
          hide = $(this).data('closable');
          $(this).data('closable', true);
          return hide;
      }
  });
  </code></pre>
  
  <p>But I need to create a conditional that if user click outside the menu, the open item not close.</p>
  
  <p>This question involves Bootstrap specificities. Just using:</p>
  
  <pre><code>$(document).on('click', function(event)
  </code></pre>
  
  <p>Not answer my question completely.</p>