You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
pgfqe6ch8/app/views/issues/update.js.erb

40 lines
2.1 KiB

6 years ago
<% 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',
{"width":"85%",
"resizeType":0,
"no_label":true,
"at_id":<%= @issue.project_id%>,
"at_type":"Project",
"autoHeightMode":true,
"afterCreate":"eval(function(){ if(typeof enablePasteImg ==='function'){enablePasteImg(self);};if(typeof enableAt ==='function'){enableAt(self, \"<%=@issue.project_id %>\", 'Project');}; this.loadPlugin('autoheight')})",
"emotionsBasePath":'<%= Setting.host_name%>',
"height":300,
"allowFileManager":true,
"uploadJson":"/kindeditor/upload",
"fileManagerJson":"/kindeditor/filemanager"});
//issue_desc_editor = KindEditor.create('#issue_description',
// {"width":"85%",
// "resizeType":0,
// "no_label":true,
// "autoHeightMode":true,
// "afterCreate":"eval(function(){ if(typeof enablePasteImg ==='function'){enablePasteImg(self);} if(typeof enableAt ==='function'){enableAt(self);} this.loadPlugin(\"autoheight\")})",
// "emotionsBasePath":"http://localhost:3000","height":300,
// "allowFileManager":true,
// "uploadJson":"/kindeditor/upload",
// "fileManagerJson":"/kindeditor/filemanager"});
<%else%>
alert('<%= @issue.errors.full_messages[0].to_s%>')
<%end %>