From f9bc1efd7cdd9f9b7083bb8b47c50959b5d1cfdf Mon Sep 17 00:00:00 2001 From: huang Date: Fri, 8 Jan 2016 21:18:08 +0800 Subject: [PATCH] =?UTF-8?q?issue=E7=BC=96=E8=BE=91=E7=9A=84=E6=97=B6?= =?UTF-8?q?=E5=80=99ajax=E5=88=B7=E6=96=B0=E9=99=84=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/issues_controller.rb | 1 + app/views/issues/add_journal.js.erb | 15 +++++++++++++++ 2 files changed, 16 insertions(+) diff --git a/app/controllers/issues_controller.rb b/app/controllers/issues_controller.rb index 91a0bc902..4aa959e81 100644 --- a/app/controllers/issues_controller.rb +++ b/app/controllers/issues_controller.rb @@ -412,6 +412,7 @@ class IssuesController < ApplicationController if params[:issue_id] @issue_id = params[:issue_id] end + @priorities = IssuePriority.active respond_to do |format| format.js end diff --git a/app/views/issues/add_journal.js.erb b/app/views/issues/add_journal.js.erb index edc8d257b..eca7685cb 100644 --- a/app/views/issues/add_journal.js.erb +++ b/app/views/issues/add_journal.js.erb @@ -1,6 +1,21 @@ <% if @issue_id %> //issue详情中回复 $("#reply_div_<%= @issue_id %>").html("<%= escape_javascript(render :partial => 'issues/issue_replies', :locals => {:issue => Issue.find( @issue_id),:replies_all_i=>0}) %>"); $("#div_issue_attachment_<%=@issue.id %>").html("<%= escape_javascript(render :partial => 'issues/issue_attachments', :locals => {:issue => Issue.find( @issue_id)}) %>"); + $("#issue_edit").replaceWith('<%= escape_javascript(render :partial => 'issues/edit') %>') + sd_create_editor_from_data(<%= @issue.id%>, null, "100%"); + 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_test_<%#= @issue.id %>").html("<%#= escape_javascript(render :partial => 'issues/edit', :locals => {:issue => Issue.find( @issue_id)}) %>"); $(".homepagePostReplyBannerCount").html('回复(<%= Issue.find( @issue_id).journals.count %>)') sd_create_editor_from_data(<%= @issue.id %>, null, "100%");