Skip to content

Commit

Permalink
Issue #935208 by droplet, assert0, adrinux, Tor Arne Thune: Fixed PEC…
Browse files Browse the repository at this point in the history
…L uploadprogress bar doesn't appear.
  • Loading branch information
webchick committed Nov 11, 2011
1 parent 77c0c9a commit 4cea9fa
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
4 changes: 0 additions & 4 deletions modules/file/file.css
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,6 @@
padding: 1px 5px 2px 5px;
}

.form-managed-file div.ajax-progress div {
display: inline;
}

.form-managed-file div.ajax-progress-bar {
display: none;
margin-top: 4px;
Expand Down
1 change: 1 addition & 0 deletions modules/file/file.field.inc
Original file line number Diff line number Diff line change
Expand Up @@ -463,6 +463,7 @@ function file_field_widget_form(&$form, &$form_state, $field, $instance, $langco
'#upload_validators' => file_field_widget_upload_validators($field, $instance),
'#value_callback' => 'file_field_widget_value',
'#process' => array_merge($element_info['#process'], array('file_field_widget_process')),
'#progress_indicator' => $instance['widget']['settings']['progress_indicator'],
// Allows this field to return an array instead of a single value.
'#extended' => TRUE,
);
Expand Down
11 changes: 9 additions & 2 deletions modules/file/file.module
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ function file_menu() {
);
$items['file/progress'] = array(
'page callback' => 'file_ajax_progress',
'delivery callback' => 'ajax_deliver',
'access arguments' => array('access content'),
'theme callback' => 'ajax_base_page_theme',
'type' => MENU_CALLBACK,
Expand Down Expand Up @@ -384,7 +383,9 @@ function file_managed_file_process($element, &$form_state, $form) {
'#weight' => -5,
);

$ajax_settings['progress']['type'] ? $ajax_settings['progress']['type'] == 'bar' : 'throbber';
// Force the progress indicator for the remove button to be either 'none' or
// 'throbber', even if the upload button is using something else.
$ajax_settings['progress']['type'] = ($element['#progress_indicator'] == 'none') ? 'none' : 'throbber';
$ajax_settings['progress']['message'] = NULL;
$ajax_settings['effect'] = 'none';
$element['remove_button'] = array(
Expand Down Expand Up @@ -412,13 +413,19 @@ function file_managed_file_process($element, &$form_state, $form) {
'#type' => 'hidden',
'#value' => $upload_progress_key,
'#attributes' => array('class' => array('file-progress')),
// Uploadprogress extension requires this field to be at the top of the
// form.
'#weight' => -20,
);
}
elseif ($implementation == 'apc') {
$element['APC_UPLOAD_PROGRESS'] = array(
'#type' => 'hidden',
'#value' => $upload_progress_key,
'#attributes' => array('class' => array('file-progress')),
// Uploadprogress extension requires this field to be at the top of the
// form.
'#weight' => -20,
);
}

Expand Down

0 comments on commit 4cea9fa

Please sign in to comment.