Magnific pop-up script interferes with admin functionality

Permalink 1 user found helpful
We've installed the Magnific pop-up script (http://dimsemenov.com/plugins/magnific-popup/) on a page and it works fine except when visiting the page in admin mode. The admin bar is visible at the top but it's completely blank, along with some other problems.

After researching the problem, we can across the Concrete5 add-on Magnific (https://github.com/cdowdy/concrete5-Magnific-Popup). Anyone have success with it?

selfheal
 
enlil replied on at Permalink Reply
enlil
Although I dont have experience with either of them, this does sound like a javascript error possibly.

In edit mode is the block "hidden", meaning it only tries to render outside edit mode?
JohntheFish replied on at Permalink Reply
JohntheFish
Magnific looks like a fairly standard jQuery plugin, so as long as Magnific itself works, then it should be possible to get it working on c5 without any trouble.

You should double check your own code, its very possible the error is in your code, so crashing javascript before the dashboard bar can build itself.
selfheal replied on at Permalink Reply
selfheal
Thanks for the replies.

The javascript console does show three errors, but they wouldn't seem to be the problem because one is in some Google ad code and the other two are in the jquery code. I haven't even added any code. I've only changed some HTML in a parameter of the open function.

And there is a block of hidden content, but it's treated the same way both in and out of edit mode. I even tested with that block not being hidden and still got the problem.
JohntheFish replied on at Permalink Reply
JohntheFish
If it is there without your popup code, and breaks with your popup code, there can only be 3 reasons:

1. Something in your javascript broke the javascript

2. Something in your html broke the html. Usually an un-closed tag

3. You wrote some bad php and broke php.

Discounting (3) for now because you don't say you have been writing php, that leaves 1 or 2.

If you have script errors in the console, then you need to clear them up.

Did you check for 'not edit mode' and put your script in a jquery ready handler?


Below is a checklist:
http://www.concrete5.org/documentation/how-tos/editors/the-block-do...
mikem replied on at Permalink Reply
Number 2 is also out, as I checked the HTML and it wasn't a problem. So there must be something in the Magnific code that conflicts with Concrete5.

As a result, I have abandoned Magnific popup and will look to replace it with something else.

Thanks for your help!
mnakalay replied on at Permalink Best Answer Reply
mnakalay
Are you sure you're not loading jquery twice? Once the default C5 jquery and another through some code call?
mikem replied on at Permalink Reply
That was it! I removed Magnific's load of jquery and the problem was solved.

Awesome. Thanks!