When FCKEditor-enabled textareas appear on the same page as a Galleria (for example, in the "Post a comment" box below a node), the Galleria is built successfully but breaks almost instantaneously: the main image and caption disappear, leaving only the thumbnails. Clicking on one of the thumbnails then results in the main image and its caption being displayed twice.
I had to dig around quite a bit in Firebug to nab this one, but I got it, and the explanation is frustratingly simple: the same ajaxComplete callback that is configured to load Galleria in a lightbox gets triggered when FCKEditor initializes, causing Galleria to be loaded twice.
The fix is attached. Now the AJAX callback only initializes Galleria if there is, in fact, an open lightbox.
NOTE: These changes should not effect the lightbox functionality, but I have not tested this patch with Galleria in a lightbox. Be sure to do so before committing!
| Comment | File | Size | Author |
|---|---|---|---|
| galleria_fckeditor.patch | 713 bytes | eromba |
Comments
Comment #1
Mark Theunissen commentedAwesome, thanks! Really appreciate you helping out here. I will review and commit your other two big patches soon.
Comment #2
Mark Theunissen commentedTested with a lightbox and it works. Thanks!