title: How to do not close Dialog of jQuery UI?
body: <pre><code>    var error = 1;
      $(document).on('click', '.ui-icon-closethick', function(event){
          if(error == 1){
             alert('error');
             event.preventDefault();
             event.stopPropagation();
             return false;
          } 
      })
  </code></pre>
  
  <p>How to do not close Dialog of jQuery UI? Now if i click on close button (x) then i have alert error, but dialog is closing. </p>
  
  <p><a href="http://jsfiddle.net/UfpHz/" rel="nofollow">LIVE DEMO</a></p>