Question

Is there a way to start TinyMCE 4 in full screen mode? I just upgraded from TinyMCE 3.x, but the way it was done in 3.x does not seem to work in 4.x:

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

Any suggestions?

Was it helpful?

Solution

Found out how to do it:

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

OTHER TIPS

It is described in the official documentation too.

tinymce.activeEditor.execCommand('mceFullScreen');

be sure you have included it in the plugins like this

tinymce.init({
  selector: 'textarea',  // change this value according to your HTML
  plugins: 'fullscreen',
  menubar: 'view',
  toolbar: 'fullscreen'
});

here is a link to the official documentation.

Official docs for tinymce editor fullscreen

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top