diff options
author | David Heinemeier Hansson <david@loudthinking.com> | 2005-09-16 08:44:38 +0000 |
---|---|---|
committer | David Heinemeier Hansson <david@loudthinking.com> | 2005-09-16 08:44:38 +0000 |
commit | 9acb1f95c9853dba704be7c690c4c0746ca8e8d6 (patch) | |
tree | 85dacc82be649b5d7d1f533967fc97acb1dd7934 /actionpack/lib/action_view | |
parent | 1fb8ba7592c6a231bac62e1623645fd18b1eb951 (diff) | |
download | rails-9acb1f95c9853dba704be7c690c4c0746ca8e8d6.tar.gz rails-9acb1f95c9853dba704be7c690c4c0746ca8e8d6.tar.bz2 rails-9acb1f95c9853dba704be7c690c4c0746ca8e8d6.zip |
Make upload progress not throw JavaScript errors when there is no progress bar #2208 [Thomas Fuchs]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2252 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionpack/lib/action_view')
-rw-r--r-- | actionpack/lib/action_view/helpers/upload_progress_helper.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/actionpack/lib/action_view/helpers/upload_progress_helper.rb b/actionpack/lib/action_view/helpers/upload_progress_helper.rb index 8563ca3beb..00e5f25f3d 100644 --- a/actionpack/lib/action_view/helpers/upload_progress_helper.rb +++ b/actionpack/lib/action_view/helpers/upload_progress_helper.rb @@ -384,7 +384,7 @@ module ActionView end.to_i # TODO do animation instead of jumping - "$('#{progress_bar_id}').firstChild.firstChild.style.width='#{percent}%'" + "if($('#{progress_bar_id}')){$('#{progress_bar_id}').firstChild.firstChild.style.width='#{percent}%'}" end # Generates a nicely formatted string of current upload progress for |