Commit 75380e5f authored by webchick's avatar webchick
Browse files

Issue #1118016 by dereine, pwolanin: Fixed conditional visibility of a...

Issue #1118016 by dereine, pwolanin: Fixed conditional visibility of a managed_file() using #states attribute does not work.
parent 7379f95e
......@@ -2796,7 +2796,17 @@ function password_confirm_validate($element, &$element_state) {
*/
function theme_date($variables) {
$element = $variables['element'];
return '<div class="container-inline">' . drupal_render_children($element) . '</div>';
$attributes = array();
if (isset($element['#id'])) {
$attributes['id'] = $element['#id'];
}
if (!empty($element['#attributes']['class'])) {
$attributes['class'] = (array) $element['#attributes']['class'];
}
$attributes['class'][] = 'container-inline';
return '<div' . drupal_attributes($attributes) . '>' . drupal_render_children($element) . '</div>';
}
/**
......
......@@ -643,9 +643,18 @@ function file_managed_file_save_upload($element) {
function theme_file_managed_file($variables) {
$element = $variables['element'];
$attributes = array();
if (isset($element['#id'])) {
$attributes['id'] = $element['#id'];
}
if (!empty($element['#attributes']['class'])) {
$attributes['class'] = (array) $element['#attributes']['class'];
}
$attributes['class'][] = 'form-managed-file';
// This wrapper is required to apply JS behaviors and CSS styling.
$output = '';
$output .= '<div class="form-managed-file">';
$output .= '<div' . drupal_attributes($attributes) . '>';
$output .= drupal_render_children($element);
$output .= '</div>';
return $output;
......
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