dimsemenov/Magnific-Popup — pull request #39 by DracoLi (2013-05-07 14:43:46+00:00)
Title: Fixed popup bug when using ajax content type

So I was using the plugin to display some ajax content and noticed that somehow clicking anywhere on my popup content will close the popup (I had `closeOnContentClick` set to `false`).

Investigated and realized that's because my ajax content's got a bunch of nodes (not just one parent node that gets included by magnific popup). However magnific popup only checks for the first node of the content `mfp.content[0] && !$.contains(mfp.content[0], target)` to see if the target is contained in the content.

Just looping through all the nodes of the content to check for `contains` fixed it for me.