Hi guys,

Have the caption working o.k. but it seems my alignment isn't being propagated. I have assigned the alignment to the image.
The container span has the following class:

image-caption-container image-caption-container-

Any clues?

CommentFileSizeAuthor
#3 rewrite_image_caption_js.patch1.7 KBpwaterz
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

delmarr’s picture

I'm having the same issue. subscribing.

delmarr’s picture

In image_caption.js If you change line 14 to
$(this).wrap("<span class=\"image-caption-container\" style=\"display:block;" + style + "; \"></span>");

This seems to fix my issue. It's on my list to learn to submit patches, but i hope this will do for now.

pwaterz’s picture

I made a few changes to the image_caption.js, seems to fix a lot of issues. Here is the patch.

hixster’s picture

From a few goes at getting image captions to work and my experience with this module- it seems that the 'alignment' variable never gets a value.
Maybe its' the way I have my WYSIWYG editor setup -I never get an align="value" in the final out put HMTL, only a style value with float="left" or "right"

So with that in mind , I changed line 9 in the image_caption.js to read

    var alignment = $(this).css('float')

My image wrapper then has the following classes:

<span class="image-caption-container right image-caption-container-right">

This means I can now add custom padding or margins depending on which side the image is floated on.
Hope that helps someone..