项目issue:编辑issue后点击确定按钮,却还是返回的编辑模式

This commit is contained in:
daiao 2016-09-13 14:47:05 +08:00
parent a3f444819e
commit 8626692367
3 changed files with 17 additions and 1 deletions

View File

@ -3,7 +3,7 @@
<%= import_ke(enable_at: true, prettify: false, init_activity: false) %>
<% end %>
<%= labelled_form_for @issue, :html => {:id => 'issue-form', :multipart => true, :remote => true} do |f| %>
<%= labelled_form_for @issue, :html => {:id => 'issue-form', :multipart => true} do |f| %>
<%= error_messages_for 'issue', 'time_entry' %>
<%= render :partial => 'conflict' if @conflict %>
<!--编辑的整个属性-->

View File

@ -1,3 +1,8 @@
/* $("#reply_div_<%#= @issue.id %>").html("<%#= escape_javascript(render :partial => 'issues/issue_replies', :locals => {:issue => @issue}) %>");
$("#issue_detail_show").html('<%#= escape_javascript(render :partial => 'issues/detail') %>');
$("#issue_edit_show").html('<%#= escape_javascript(render :partial => 'issues/edit') %>');
$("#div_issue_attachment_<%#=@issue.id %>").html("<%#= escape_javascript(render :partial => 'issues/issue_attachments', :locals => {:issue => @issue}) %>");
sd_create_editor_from_data(<%#= @issue.id %>, null, "100%", "<%#= @issue.class.name %>");*/
location.reload();
issue_desc_editor = KindEditor.create('#issue_description',
@ -14,3 +19,5 @@ issue_desc_editor = KindEditor.create('#issue_description',
"uploadJson":"/kindeditor/upload",
"fileManagerJson":"/kindeditor/filemanager"});
// $("#issue_test_<%#= @issue.id %>").html("<%#= escape_javascript(render :partial => 'issues/edit', :locals => {:issue => Issue.find( @issue_id)}) %>");
// $(".homepagePostReplyBannerCount").html('<%#= escape_javascript(render :partial => 'issues/issue_reply_banner') %>');
// sd_create_editor_from_data(<%#= @issue.id%>, null, "100%","<%#= @issue.class.name %>");

View File

@ -1,4 +1,13 @@
<% if @saved %>
/*$("#issue_detail").replaceWith('<%#= escape_javascript(render :partial => 'issues/detail') %>');
$("#issue_edit").replaceWith('<%#= escape_javascript(render :partial => 'issues/edit') %>');
$("#issue_detail").show();
$("#issue_edit").hide();
$("#reply_div_<%#= @issue.id %>").html("<%#= escape_javascript(render :partial => 'issues/issue_replies', :locals => {:issue => @issue,:replies_all_i=>0}) %>");
sd_create_editor_from_data(<%#= @issue.id%>, null, "100%","<%#=@issue.class.name%>");
$(".homepagePostReplyBannerCount").html('<%#= escape_javascript(render :partial => 'issues/issue_reply_banner') %>');*/
location.reload();
//edit里的编辑器貌似显示不出来所以手动js生成。
issue_desc_editor = KindEditor.create('#issue_description',