как сделать входной доступ только для чтения - PullRequest
0 голосов
/ 25 июня 2018

Я хочу сделать входной сигнал только для чтения.Я пытался с приведенным ниже кодом.Пожалуйста, помогите мне с этой проблемой.

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: [

    ]

});

Ответы [ 2 ]

0 голосов
/ 27 июня 2018

Если вы используете версию 4.x, удалите опцию readonly: true и попробуйте

setup: function (editor) {
    editor.setMode("readonly")
    },

http://fiddle.tinymce.com/Lugaab/2

0 голосов
/ 25 июня 2018

Как указано в документации TinyMCE https://www.tinymce.com/docs-3x/reference/configuration/Configuration3x@readonly/, атрибут readonly должен быть установлен в '1', а не в 'true'.

tinymce.init({
    selector: '#deliberations',
    menubar: false,
    readonly: 1, 
    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: [

    ]

});
Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...