Commit 6331458e authored by genjohnson's avatar genjohnson Committed by joseph.olstad

Issue #2886267 by genjohnson, joseph.olstad: "media" class picks up styles from Bootstrap

parent fe9f1c7e
......@@ -342,6 +342,10 @@ function media_wysiwyg_token_to_markup($match, $wysiwyg = FALSE, $langcode = NUL
'media-element-container',
'media-' . $element['content']['file']['#view_mode'],
);
if (variable_get('media_wysiwyg_remove_media_class', FALSE)) {
$classes = $element['content']['#attributes']['class'];
$element['content']['#attributes']['class'] = array_diff($classes, array('media'));
}
}
// Conditionally add a pre-render if the media filter output is be cached.
......
......@@ -77,6 +77,7 @@ function media_wysiwyg_uninstall() {
variable_del('media_wysiwyg_use_link_text_for_filename');
variable_del('media_wysiwyg_alignment');
variable_del('media_wysiwyg_external_link');
variable_del('media_wysiwyg_remove_media_class');
}
/**
......
......@@ -319,6 +319,14 @@ function media_wysiwyg_form_media_admin_config_browser_alter(&$form, &$form_stat
'#default_value' => variable_get('media_wysiwyg_external_link', FALSE),
'#description' => t('If checked there will be a new field when embedding that will allow users to link to the media to urls'),
);
$form['wysiwyg']['media_wysiwyg_remove_media_class'] = array(
'#type' => 'checkbox',
'#title' => t('Remove the ".media" class from embedded media'),
'#description' => t('If checked, the ".media" class will be removed from embedded media. Particularlly for sites using Bootstrap, the ".media" class can cause CSS to be unexpectedly applied to embedded media.'),
'#default_value' => variable_get('media_wysiwyg_remove_media_class', FALSE),
);
$form['#submit'][] = 'media_wysiwyg_admin_config_browser_pre_submit';
}
......
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