From 9ef8f0f612d4078d966dad2b3a1fd62860ed4682 Mon Sep 17 00:00:00 2001 From: yuanke <249218296@qq.com> Date: Fri, 4 Nov 2016 18:59:48 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BC=B9=E6=A1=86BUG=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../attachments/upload_attachment_version.js.erb | 4 ++-- public/javascripts/application.js | 14 ++++++++------ 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/app/views/attachments/upload_attachment_version.js.erb b/app/views/attachments/upload_attachment_version.js.erb index 5c74d70cf..7803d73cd 100644 --- a/app/views/attachments/upload_attachment_version.js.erb +++ b/app/views/attachments/upload_attachment_version.js.erb @@ -1,7 +1,7 @@ <% if @flag %> hideModal(); - alert('更新成功') + alert('更新成功'); $(".re_search").submit(); // 为了刷新 <%else%> - $("#upload_file_count").html('(更新失败)') + $("#upload_file_count").html('(更新失败)'); <%end %> \ No newline at end of file diff --git a/public/javascripts/application.js b/public/javascripts/application.js index bc9f86880..05e6457cc 100644 --- a/public/javascripts/application.js +++ b/public/javascripts/application.js @@ -426,13 +426,15 @@ function hideModal(el) { if($("#popupWrap").length > 0){ $("#popupWrap").hide(); } - var modal; - if (el) { - modal = $(el).parents('.ui-dialog-content'); - } else { - modal = $('#ajax-modal'); + else{ + var modal; + if (el) { + modal = $(el).parents('.ui-dialog-content'); + } else { + modal = $('#ajax-modal'); + } + modal.dialog("close"); } - modal.dialog("close"); } function submitPreview(url, form, target) {