Commit 2a677a83 authored by s_leu's avatar s_leu Committed by frjo
Browse files

Issue #1429784 by s_leu, mgifford, digitaldonkey: Use data attribute instead...

Issue #1429784 by s_leu, mgifford, digitaldonkey: Use data attribute instead of rel to be HTML5 valid
parent 029ea76d
......@@ -27,4 +27,6 @@
* use the file's name. i.e. __title_or_filename__.
*/
?>
<a href="<?php print $path; ?>" title="__title__" class="colorbox colorbox-insert-image" rel="<?php print $gallery_id; ?>"><img src="<?php print $url; ?>" <?php if ($width && $height): ?>width="<?php print $width; ?>" height="<?php print $height; ?>" <?php endif; ?>alt="__alt__" title="__title__" class="<?php print $class; ?>" /></a>
<a href="<?php print $path; ?>" title="__title__" class="colorbox colorbox-insert-image" data-colorbox-gallery="<?php print $gallery_id; ?>">
<img src="<?php print $url; ?>" <?php if ($width && $height): ?>width="<?php print $width; ?>" height="<?php print $height; ?>" <?php endif; ?>alt="__alt__" title="__title__" class="<?php print $class; ?>" />
</a>
......@@ -182,7 +182,7 @@ function theme_colorbox_imagefield($variables) {
'attributes' => array(
'title' => $variables['title'],
'class' => $class,
'rel' => $variables['gid'],
'data-colorbox-gallery' => $variables['gid'],
),
'language' => array('language' => NULL),
);
......
......@@ -14,6 +14,10 @@ Drupal.behaviors.initColorbox = {
}
}
settings.colorbox.rel = function () {
return $(this).data('colorbox-gallery')
};
$('.colorbox', context)
.once('init-colorbox')
.colorbox(settings.colorbox);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment