title: Bootstrap Modal override close event
body: <p>I have my Bootstrap modal alert. I can handle the click event on the "ok" button like:</p>
  
  <pre><code>$('button[data-dismiss="ok"]', confirmModal).on('click', function (event) {
      // ...
  });
  </code></pre>
  
  <p>but I want to handle differently the "cancel/modal" button:</p>
  
  <pre><code>$('button[data-dismiss="modal"]', confirmModal).on('click', function (event) {
     // ...
  });
  </code></pre>
  
  <p>What happens is that when handling the <code>modal</code> event, the modal window will be closed, but it will not return the focus to the document for some reason.
  <a href="https://codepen.io/anon/pen/GGBxOW" rel="nofollow noreferrer">Codepen</a></p>