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!

CommentFileSizeAuthor
galleria_fckeditor.patch713 byteseromba

Comments

Mark Theunissen’s picture

Assigned: Unassigned » Mark Theunissen

Awesome, thanks! Really appreciate you helping out here. I will review and commit your other two big patches soon.

Mark Theunissen’s picture

Status: Needs review » Fixed

Tested with a lightbox and it works. Thanks!

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.