Commit 8c09b321 authored by jurgenhaas's avatar jurgenhaas

Issue #2744481 by brockfanning: Inline style colorbox doesn't seem to work

parent 3e421ae5
......@@ -147,6 +147,7 @@ function colorbox_field_formatter_field_formatter_settings_form($field, $instanc
'#title' => t('Anchor'),
'#type' => 'textfield',
'#default_value' => $settings['colorbox_field_formatter_anchor'],
'#description' => t('This can be used with the "inline" style by entering the ID (without the leading "#") of the inline content to colorbox.'),
);
$element['colorbox_field_formatter_class'] = array(
'#title' => t('Class'),
......@@ -274,7 +275,10 @@ function colorbox_field_formatter_field_formatter_view($entity_type, $entity, $f
$options['query']['iframe'] = 'true';
}
if (!empty($settings['colorbox_field_formatter_anchor'])) {
$options['query']['fragment'] = $settings['colorbox_field_formatter_anchor'];
$options['fragment'] = $settings['colorbox_field_formatter_anchor'];
}
if ($settings['colorbox_field_formatter_style'] == 'colorbox-inline') {
$options['query']['inline'] = 'true';
}
if (!empty($settings['colorbox_field_formatter_class'])) {
$options['attributes']['class'] = array_merge($options['attributes']['class'], explode(' ', $settings['colorbox_field_formatter_class']));
......
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