title: How to check if leaflet popup is open?
body: <p>How can I check, if a leaflet popup is open?</p>
  
  <p>I have seen, that there is an <code>.isOpen</code> event in the documentation (<a href="https://leafletjs.com/reference-1.6.0.html" rel="nofollow noreferrer">methods</a>), but I am not so familiar with the integration of it. I tried something (horrible) like this:</p>
  
  <pre><code>var marker = L.popup();
  
  if($(marker).isOpen) {
  // do something
  }
  else {
  // do nothing
  }
  </code></pre>