重置TinyMCE的取消按钮

时间:2017-07-31 10:48:57

标签: javascript jquery tinymce

我正在使用TinyMCE和jQuery发表评论。当我发表评论时,我想重置TinyMCE,重置TinyMCE取消按钮等等。

enter image description here

tinyMCE.init({
    menubar: false,
    plugins: [
        'fullscreen code paste table contextmenu advlist autolink lists link'
    ]
    ,language: 'zh_CN'
    ,toolbar: 'undo redo | insert | styleselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent  | fullscreen code'
    ,selector:'#comment'
    ,paste_merge_formats: true
    ,paste_word_valid_elements: "b,strong,i,em,h1,h2"
    ,setup: function(editor) {
        editor.on('keydown change', function() {
            comment = editor.getContent();
        });
    }
});  

 tinyMCE.editors[0].setContent("");   //can make tinyMCE comment empty

但我想要tinyMCE取消按钮灰色

1 个答案:

答案 0 :(得分:1)

您是否要重置undo按钮(不确定cancel按钮的含义)?如果是这样,你就这样做了:

tinyMCE.editors[0].undoManager.clear();