How to start TinyMCE 4 in full screen mode?
Asked Answered
A

2

10

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?

Aristocracy answered 8/4, 2014 at 14:2 Comment(0)
A
22

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>
Aristocracy answered 9/4, 2014 at 10:9 Comment(0)
G
1

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

Grind answered 28/8, 2021 at 8:4 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.