This commit is contained in:
sw 2015-09-08 14:44:50 +08:00
commit 48cb07c453
4 changed files with 22 additions and 5 deletions

View File

@ -141,7 +141,7 @@
image.wrap(element);
}
}
$('#activity_description_<%= user_activity_id %> a').colorbox({rel:'nofollow', close: "关闭"});
$('#activity_description_<%= user_activity_id %> a').colorbox({rel:'nofollow', close: "关闭", returnFocus: false});
});
</script>

View File

@ -9,7 +9,6 @@
span.ke-icon-emoticons:hover{background-position:-79px -671px;width:50px;height:26px;}
div.ke-toolbar .ke-outline{border:none;}
.ke-inline-block{display: none;}
.ke-container{height: 30px !important;}
</style>
<% user_activities.each do |user_activity|
if user_activities %>

View File

@ -17,7 +17,8 @@ module RailsKindeditor
output_buffer = ActiveSupport::SafeBuffer.new
output_buffer << build_text_area_tag(name, method, self, options, input_html)
output_buffer << javascript_tag(js_replace(input_html['id'],options.merge(window_onload: 'true',
afterCreate: 'eval(function(){enablePasteImg(self);})')))
:autoHeightMode=>true,
afterCreate: 'eval(function(){enablePasteImg(self);this.loadPlugin("autoheight")})')))
end
def kindeditor_upload_json_path(*args)

View File

@ -1,14 +1,31 @@
function init_editor(params){
var minHeight;
var editor = params.kindutil.create(params.textarea, {
resizeType : 1,minWidth:"1px",width:"100%",height:"80px",
items:['emoticons'],
resizeType : 1,minWidth:"1px",width:"100%",height:"30px",minHeight:"30px",
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));
},
afterCreate:function(){
var toolbar = $("div[class='ke-toolbar']",params.div_form);
$(".ke-outline>.ke-toolbar-icon",toolbar).append('表情');
params.toolbar_container.append(toolbar);
//init
var edit = this.edit;
var body = edit.doc.body;
edit.iframe[0].scroll = 'no';
body.style.overflowY = 'hidden';
//reset height
var edit = this.edit;
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));
}
}).loadPlugin('paste');
return editor;