2014-04-08 71 views
7

有沒有辦法在全屏模式下啓動TinyMCE 4?我剛剛從TinyMCE 3.x升級,但它在3.x中完成的方式在4.x中似乎不起作用:如何在全屏模式下啓動TinyMCE 4?

<head> 
<script type="text/javascript" src="TinyMCE/tinymce.min.js"></script> 
<script type="text/javascript"> 
    tinyMCE.init({ 
    oninit : function() { 
     tinyMCE.get('editor').execCommand('mceFullScreen'); 
    } 
    }); 
</script> 
</head> 

<body> 
    <textarea id="editor"></textarea> 
</body> 

有什麼建議嗎?

回答

16

發現瞭如何做到這一點:

<head> 
<script type="text/javascript" src="TinyMCE/tinymce.min.js"></script> 
<script type="text/javascript"> 
    tinyMCE.init({ 
    plugins: [ 'fullscreen' ], 
    setup: function(editor) { 
     editor.on('init', function(e) { 
     editor.execCommand('mceFullScreen'); 
     }); 
    } 
    }); 
</script> 
</head> 

<body> 
    <textarea id="editor"></textarea> 
</body>