title: jQuery Mobile panel - check if it is open
body: <p>I'm trying to check if my panel is open or closed.</p>
  
  <p>I tried like this:</p>
  
  <pre><code>$(document).on('open', '.ui-panel', function(){
     console.log('open');     
  })
  </code></pre>
  
  <p>but nothing happens. </p>
  
  <p>How I can set up an event listener for jQ mobile panel?</p>
  
  <p>Open isn't a problem, cause I'll just add <code>.panel('open')</code> to button click and then <code>console.log()</code>, but what with close? Panel will close when I'll click outside, how to catch that moment?</p>