From 5a950b227abe29ead41166e2b9e143b6d8f6bbb7 Mon Sep 17 00:00:00 2001 From: huang Date: Thu, 2 Jul 2015 15:53:12 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AF=BE=E7=A8=8B=E3=80=81=E9=A1=B9=E7=9B=AE?= =?UTF-8?q?=E4=B8=8A=E4=BC=A0=E6=96=87=E4=BB=B6=E4=B8=BA=E7=A9=BA=E6=97=B6?= =?UTF-8?q?=E7=BB=99=E5=87=BA=E6=8F=90=E9=86=92?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/files/create.js.erb | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/app/views/files/create.js.erb b/app/views/files/create.js.erb index 07d0c06f2..a7e92ca2f 100644 --- a/app/views/files/create.js.erb +++ b/app/views/files/create.js.erb @@ -25,16 +25,25 @@ $('#upload_file_div').slideToggle('slow'); closeModal(); $("#resource_list").html('<%= j(render partial: "project_file_new" ,locals: {project: @project}) %>'); // 添加文件上传成功提示, - var div = $('
文件上传成功!
'); - $("#course_list").prepend(div); - setTimeout( function(){div.remove();},3000) + <% if params[:attachments].nil? %> + var div = $('
您上传了一个空文件!
'); + <% else %> + var div = $('
文件上传成功!
'); + + <% end %> + $("#course_list").prepend(div); + setTimeout( function(){div.remove();},3000) <%elsif @course%> closeModal(); $("#resource_list").html('<%= j(render partial: "course_file" ,locals: {course: @course}) %>'); $("#courses_files_count_info").html("<%= @all_attachments.count%>"); $("#courses_files_count_nav").html("(<%= @all_attachments.count%>)") // 添加文件上传成功提示, - var div = $('
文件上传成功!
'); + <% if params[:attachments].nil? %> + var div = $('
您上传了一个空文件!
'); + <% else %> + var div = $('
文件上传成功!
'); + <% end %> $("#course_list").prepend(div); setTimeout( function(){div.remove();},3000) <% end %>