code: function(e) {
          var element = this.element;
  
          // Since the modal element covers the entire viewport, we can't trigger the `clickout` event
          // So instead we have to bind a click event to the outer modal element to hide it
          // This should not trigger if a child element is clicked
          if (e.type === 'click' && !$(e.target).is(element)) {
              return;
          }
  
          e.preventDefault();
  
          // If the modal is loading (AJAX) or is not shown, exit early
          // This stops cases where the blackout can be clicked early
          if (!element.is(':shown') || element.hasClass('is-loading')) {
              return;
          }
  
          this.hide();
      }
docs: Event handler for hide().
  
  @private
  @param {jQuery.Event} e