我正在使用以下内容:
<textarea
data-ui-tinymce="tinymceOptions"
data-ng-disabled="modal.action=='delete'"
data-ng-model="modal.formData.text"
id="inputText"
rows="20"
required></textarea>
当tinymce出现的高度只有几厘米。如何在默认值首次出现时更改其高度?
下面是我正在使用的选项列表:
selector: "textarea",
plugins: [
"advlist autolink autosave link image lists charmap print preview hr anchor pagebreak spellchecker",
"searchreplace wordcount visualblocks visualchars code fullscreen insertdatetime media nonbreaking",
"table contextmenu template textcolor paste fullpage textcolor"
],
toolbar1: "bold italic underline strikethrough | alignleft aligncenter alignright alignjustify | styleselect fontselect fontsizeselect",
toolbar2: "cut copy paste | searchreplace | bullist numlist | outdent indent blockquote | undo redo | code | inserttime preview | forecolor backcolor",
toolbar3: "table | hr removeformat | subscript superscript | charmap | print fullscreen | spellchecker | visualchars visualblocks nonbreaking template pagebreak restoredraft",
menubar: false,
toolbar_items_size: 'small',
templates: [
{title: 'Test template 1', content: 'Test 1'},
{title: 'Test template 2', content: 'Test 2'}
]
7条答案
按热度按时间6jygbczu1#
从javascript
从html
u2nhd7ah2#
你应该在CSS中设置容器对象的高度:
uxh89sit3#
tinyMCE版本之前4.X那么这段代码就可以工作了
tinyMCE版本4。X和在之后,那么这段代码就可以工作了
e4eetjau4#
对于TinyMCE的全局高度设置,请编辑 www.example.com 项目:
对于每个小部件的设置,请在表单类中使用
mce_attrs
:使用django-tinymce 2测试。7.0.
**在后台:**您可以在为textarea生成的HTML的data-mce-conf属性中看到类似
"height": 120,
的字符串。否则,就会出问题。vptzau2j5#
对我有效(参见setTimeout部分)
j7dteeu86#
将此css添加到您的自定义样式表中,否则它将降低所有现有编辑器的高度。
rkkpypqq7#
对于版本6,下面的代码应该可以工作