diff --git a/app/views/courses/_courses_jours.html.erb b/app/views/courses/_courses_jours.html.erb index 5ce51ff7b..12dd67c91 100644 --- a/app/views/courses/_courses_jours.html.erb +++ b/app/views/courses/_courses_jours.html.erb @@ -10,11 +10,11 @@ div.respond-form .reply_btn{margin-left:565px;margin-top:5px;} div.recall_con{width:570px;} div.recall_con .reply_btn{margin-left:525px;margin-top:5px;} - .ke-container{height: 80px !important;} + /*.ke-container{height: 80px !important;}*/ <%= javascript_include_tag "/assets/kindeditor/kindeditor",'/assets/kindeditor/pasteimg',"init_KindEditor" %>

<%= l(:label_leave_message) %>

@@ -62,6 +62,7 @@ params.contentmsg = $("p[nhname='contentmsg']",params.div_form); params.toolbar_container = $("div[nhname='toolbar_container']",params.div_form); params.cancel_btn = $("input[nhname='cancel_btn']",params.div_form); + params.height = 55; if(params.textarea.data('init') == undefined){ params.editor = init_editor(params); init_form(params); diff --git a/public/javascripts/init_KindEditor.js b/public/javascripts/init_KindEditor.js index f2b7915ad..67616fd22 100644 --- a/public/javascripts/init_KindEditor.js +++ b/public/javascripts/init_KindEditor.js @@ -1,14 +1,16 @@ function init_editor(params){ var minHeight; var editor = params.kindutil.create(params.textarea, { - resizeType : 1,minWidth:"1px",width:"100%",height:"30px",minHeight:"30px", + resizeType : 1,minWidth:"1px",width:"100%", + height:params.height == undefined ? "30px":params.height+"px", + minHeight:params.height == undefined ? "30px":params.height+"px", items:['emoticons'], afterChange:function(){//按键事件 nh_check_field({content:this,contentmsg:params.contentmsg,textarea:params.textarea}); var edit = this.edit; var body = edit.doc.body; edit.iframe.height(minHeight); - this.resize(null, Math.max((params.kindutil.IE ? body.scrollHeight : body.offsetHeight) + 30, minHeight)); + this.resize(null, Math.max((params.kindutil.IE ? body.scrollHeight : body.offsetHeight) + (params.height == undefined ? 30:params.height), minHeight)); }, afterCreate:function(){ var toolbar = $("div[class='ke-toolbar']",params.div_form); @@ -24,7 +26,7 @@ function init_editor(params){ var body = edit.doc.body; minHeight = params.kindutil.removeUnit(this.height); edit.iframe.height(minHeight); - this.resize(null, Math.max((params.kindutil.IE ? body.scrollHeight : body.offsetHeight)+ 30 , minHeight)); + this.resize(null, Math.max((params.kindutil.IE ? body.scrollHeight : body.offsetHeight)+ (params.height == undefined ? 30:params.height) , minHeight)); } }).loadPlugin('paste'); @@ -85,6 +87,7 @@ function nh_reset_form(params){ } function init_KindEditor_data(id){ + var height = arguments[1] ? arguments[1] : undefined; KindEditor.ready(function (K) { $("div[nhname='new_message_" + id + "']").each(function () { var params = {}; @@ -99,7 +102,7 @@ function init_KindEditor_data(id){ params.toolbar_container = $("div[nhname='toolbar_container_" + id + "']", params.div_form); params.cancel_btn = $("#new_message_cancel_btn_" + id); params.submit_btn = $("#new_message_submit_btn_" + id); - + params.height = height; if (params.textarea.data('init') == undefined) { params.editor = init_editor(params); init_form(params);