title: leaflet.js check if a marker has its bound popup open
body: <p>As per subject how can I check if a marker has a popup open?</p>
  
  <p>eg.</p>
  
  <pre><code>var m = new L.marker([2,1]).addTo(map).bindPopup('test');
  </code></pre>
  
  <p>Clicking on the marker will obviously open the popup.</p>
  
  <p>Is there any functionality such as:</p>
  
  <pre><code>if(m.popupOpen() == true) {
      // do somehting
  }
  </code></pre>
  
  <p>I have tried the following:</p>
  
  <pre><code>m.on('click', function(e) {
      if(m._map.hasLayer(m._popup)) {
          // Do something
      }
  }
  </code></pre>
  
  <p>But it's very flaky. On chrome it will run, on android browser if will fire on the second click so it is not really reliable. </p>
  
  <p>Is there any standard way of doing this?</p>
  
  <p>Thanks</p>