title: Magnific Popup Callback when closing
body: <p>I am using <a href="http://dimsemenov.com/plugins/magnific-popup/" rel="noreferrer">Magnific Popup</a> for uploading images. When the user clicks or presses the close button, I'd like to get confirmation from the user whether to close on not. </p>
  
  <p>This is my Javascript:</p>
  
  <pre><code>$('#upload').magnificPopup({
      type:'inline',
      callbacks: {
          close: function(){
              if( confirm("Are you sure you want to close?") ) {
                return true;
              }
                return false;
              }
            }
        }
  });
  </code></pre>
  
  <p>But it is not working.</p>