<% if RedmineCkeditor.enabled? %>
  destroyEditor("issue_description");
<% end %>

$('#all_attributes').html('<%= escape_javascript(render :partial => 'form') %>');

<% if User.current.allowed_to?(:log_time, @issue.project) %>
  $('#log_time').show();
<% else %>
  $('#log_time').hide();
<% end %>
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"});