issue回复的at出错

This commit is contained in:
guange 2015-12-18 16:50:44 +08:00
parent 71a0802a49
commit d0e139650f
2 changed files with 8 additions and 4 deletions

View File

@ -1,9 +1,9 @@
<%= content_for(:header_tags) do %>
<%= import_ke(enable_at: false) %>
<%= import_ke(enable_at: true) %>
<%= javascript_include_tag 'create_kindeditor'%>
<% end %>
<script>
sd_create_editor_from_data(<%= @issue.id%>, null, "100%");
sd_create_editor_from_data(<%= @issue.id%>, null, "100%", "<%= @issue.class.name %>");
</script>
<script type="text/javascript">
$(function(){

View File

@ -3,6 +3,7 @@ function sd_create_editor(params){
// var minHeight; //最小高度
var paramsHeight = params.height; //设定的高度
var id = arguments[1] ? arguments[1] : undefined;
var type = arguments[2] ? arguments[2] : '';
var paramsWidth = params.width == undefined ? "100%" : params.width;
var editor = params.kindutil.create(params.textarea, {
@ -74,7 +75,9 @@ function sd_create_editor(params){
edit.html("<span id='hint' style='color: #999999; font-size: 12px'>我要回复</span>");
this.resize(null,paramsHeight);// Math.max((params.kindutil.IE ? body.scrollHeight : body.offsetHeight)+ paramsHeight , paramsHeight)
// params.toolbar_container.hide();
if(typeof enableAt === 'function'){
enableAt(this, id, type);
}
}
}).loadPlugin('paste');
return editor;
@ -136,6 +139,7 @@ function sd_reset_editor_form(params){
function sd_create_editor_from_data(id){
var height = arguments[1] ? arguments[1] : undefined;
var width = arguments[2] ? arguments[2] : undefined;
var type = arguments[3] ? arguments[3] : undefined;
KindEditor.ready(function (K) {
$("div[nhname='new_message_" + id + "']").each(function () {
var params = {};
@ -153,7 +157,7 @@ function sd_create_editor_from_data(id){
params.height = height;
params.width = width;
if (params.textarea.data('init') == undefined) {
params.editor = sd_create_editor(params,id);
params.editor = sd_create_editor(params,id, type);
sd_create_form(params);
params.cancel_btn.click(function () {
sd_reset_editor_form(params);