javascript - 如何使tinymce输入只读
问题描述
我想让tinymce输入只读。我试过下面的代码。请帮我解决这个问题。
tinymce.init({
selector: '#deliberations',
menubar: false,
readonly: true,
branding: false,
height: 100,
max_height: 400,
theme: 'modern',
toolbar: false,
toolbar_items_size: 'small',
plugins: ['advlist autolink lists link image charmap print preview hr anchor pagebreak','searchreplace wordcount visualblocks visualchars code fullscreen','insertdatetime media nonbreaking save table contextmenu directionality','emoticons template paste textcolor colorpicker textpattern imagetools codesample toc help'],
toolbar1: 'insert | undo redo | styleselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link image print preview media | forecolor backcolor emoticons | fullscreen | table',
image_advtab: true,
templates: [{
title: 'Test template 1',
content: 'Test 1'
},
{
title: 'Test template 2',
content: 'Test 2'
}
],
content_css: [
]
});
解决方案
如果您使用的是 4.x 版,请删除 readonly: true 选项并尝试
setup: function (editor) {
editor.setMode("readonly")
},
推荐阅读
- javascript - 如何更改网格中框的颜色
- android - 从另一个 BroadcastReceiver 中注册 BroadcastReceiver 时发生 ReceiverCallNotAllowedException
- javascript - Discord.js 机器人上的冷却脚本出错
- python - 无法向具有多对多关系的表添加条目
- common-lisp - 为什么在这种情况下 find 函数返回 NIL?
- google-chrome-extension - 如何启用 chrome 扩展来显示额外的搜索结果(类似于 Evernote 以前的做法)?
- css - 如何仅使用 CSS 制作隐藏的下拉菜单?
- python-3.x - 我们如何使用 django 创建服务器端模板
- python - 如何在python中从用户那里获取布尔输入?
- cakephp - Cakepdf 不显示 DomPdf 的图像