Open drgullin opened 11 years ago
This happens because of the wrong clicked target checking. Once some element is clicked to replace a current popup, both popups are closed, because plugin checks for a clicked target existance inside the new content, not the previous one. This means, if there's no clicked target clone inside the replacing content, popup will be closed.
Here's a hotfix:
mfp.prevContent = mfp.content;
if (mfp.prevContent) {
if (!$.contains(mfp.prevContent[0], target)) {
return true;
} else {
return false;
}
} else {
same line, append:
}
if (!mfp.isOpen) {}
mfp.prevContent = null;
Since this solution may have some side effects, I don't make a pull request.
It works for me both for inline and image (gallery) types.
Thank you, I'll look into it.
By the way, to fix this you may just add event.stopImmediatePropagation();
on that .dynamic
click event handler, so the event won't come to popup at all.
You're welcome.
Same issue for the ajax loaded popups, current hotfix doesn't help.
Looking for a hack too.
Has this been resolved?
I am trying to open a magnific popup from a link within an ajax generated magnific popup, without success...
@xfechx did you ever resolve your issue? I'm having the same issue as mentioned here: #852
Hi @jpcharrier, no I still unable to resolve it. Can't swap ajax content in one magnific popup.
It works with normal non-ajax content though...
Let me know if you find a workaround!
On Tue, 19 Apr 2016, 07:54 jpcharrier notifications@github.com wrote:
@xfechx https://github.com/xfechx did you ever resolve your issue? I'm having the same issue as mentioned here: #852 https://github.com/dimsemenov/Magnific-Popup/issues/852
— You are receiving this because you were mentioned. Reply to this email directly or view it on GitHub https://github.com/dimsemenov/Magnific-Popup/issues/227#issuecomment-211597807
@xfechx you will be the first to find out (other than the boss of course!). There must be a way... I might try and abstract the ajax away from Magnific and use raw JS there to achieve it.
Still think it would be great if there was a simple update method for ajax'd content!
I agree! It would totally change many things around the web and actively updating popups with ajax loaded content!
On Tue, 19 Apr 2016, 15:16 jpcharrier notifications@github.com wrote:
@xfechx https://github.com/xfechx you will be the first to find out (other than the boss of course!). There must be a way... I might try and abstract the ajax away from Magnific and use raw JS there to achieve it.
Still think it would be great if there was a simple update method for ajax'd content!
— You are receiving this because you were mentioned. Reply to this email directly or view it on GitHub https://github.com/dimsemenov/Magnific-Popup/issues/227#issuecomment-211731678
Has there been any update on this?
This doesn't work for a dynamically created popups.
Here's an example http://jsbin.com/esebEGa/1
Child static works well:
Child dymanic doesn't work:
If child dymanic link is clicked, both popups are closed.
I've also tried this solution https://github.com/dimsemenov/Magnific-Popup/issues/53#issuecomment-17804411 - same result, both popups are closed once you try to open a dynamically created popup.