From 9acb1f95c9853dba704be7c690c4c0746ca8e8d6 Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Fri, 16 Sep 2005 08:44:38 +0000 Subject: 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 --- actionpack/lib/action_view/helpers/upload_progress_helper.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'actionpack/lib/action_view/helpers/upload_progress_helper.rb') 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 -- cgit v1.2.3