2016-06-09 68 views
1

这可能看起来很stpd,对不起......; rails4/ckeditor/simpleform:不知何故,f.ckeditor文本区域的主体会得到一个style =“height:200px”,我只是无法找到在哪里更改大小?任何人提示?日Thnx!Rails/Ckeditor如何更改高度?

回答

0

您需要在js中执行此操作,以便启动ckeditor。

例如

CKEDITOR.editorConfig = function (config) { 
    // ... other configuration ... 

    config.toolbar_mini = [ 
    ["Bold", "Italic", "Underline", "Strike", "-", "Subscript", "Superscript"], 
    ]; 
    config.toolbar = "simple"; 
    extraPlugins : 'uicolor', 
    height: '800px', 

    // ... rest of the original config.js ... 
} 

意味着你现在的高度是800像素。

+1

不,不工作,同样没有'行:50'我的代码(所有其它的VARS,如TE工具栏工作): 'CKEDITOR.editorConfig =函数(配置){// 配置选项 高度: “800像素”; config.toolbar = [ \t \t {名称: 'basicstyles',项目:[ '保存', '粗体', '斜体', '击', ' - ', 'RemoveFormat']}, \t \t {名:'剪贴板',项目:['剪切','复制','粘贴','PasteText','PasteFromWord',' - ','撤消','重做']}, \t \t {name:'editing ',项目:['Scayt']}, \t \t {name:'links',items:['Link','Unlink']}, \t \t {name:'tools',items:['Maximize' ]},' – BerryGJS

+2

你能看到这个extraPlugins:'uicolor'。我不知道为什么,但它解决了设置大小的问题,这就是为什么我把它放到我的代码示例中。 – Evgeny

+2

另一个选择是使用纯jQuery来设置CK $('.cke_contents').css('height','800px')的内容标签。 – Evgeny