Commit 991c93a3 authored by davidwhthomas's avatar davidwhthomas
Browse files

Make caption wrappers spans, not divs for XHTML validity (...

Make caption wrappers spans, not divs for XHTML validity  ( http://drupal.org/node/374415 ) Also, check for zero width before applying to caption container ( http://drupal.org/node/675002 )
parent 1b8120c5
Loading
Loading
Loading
Loading
+5 −3
Original line number Diff line number Diff line
@@ -8,8 +8,10 @@ $(document).ready(function(){
    var alignment = $(this).attr('align');
    //Clear image styles to prevent conflicts with parent div
    $(this).attr('style','');
    $(this).wrap("<div class=\"image-caption-container\" style=\"" + style + "; text-align: " + alignment + "\"></div>");
    $(this).wrap("<span class=\"image-caption-container\" style=\"display:block;" + style + "; text-align: " + alignment + "\"></span>");
    if(imgwidth != 'undefined' && imgwidth != 0){
      $(this).parent().width(imgwidth);
    $(this).parent().append("<div class=\"image-caption\">" + captiontext + "</div>");
    }
    $(this).parent().append("<span style=\"display:block;\" class=\"image-caption\">" + captiontext + "</span>");
  });
});
 No newline at end of file