title: How I handle x button modal
body: <p>I need to handle a button when the user clicks "X" in modal. This is what I tried:</p>
  
  <pre><code>var modal = bootbox.dialog({
  
      message: dataTopicRilievo,
      title: 'Selezionare data topic in rilievo',
      buttons: {
      success: {
      label: "Save",
      className: "btn-primary save",
      callback: function() {
  
          console.log("HIII");
  
      },
      close: function(event,ui) {
      console.log("CLOSEEEEEEEEEEEEE");    
      }
  });
  </code></pre>
  
  <p>But this first version doesn't work so I used:</p>
  
  <pre><code>modal.on('hidden.bs.modal', function (e) {
  
      console.log("CLOSEEEEEEEEEEEEE");
  
  });
  </code></pre>
  
  <p>This part of code is not correct because the method that calls the modal is also hidden from positive action. Anyone can help me?</p>