2

after the tinymce.init() i can toggle the readOnly setting like this:

editor.mode.set("design");
editor.mode.set("readonly");

but how can i toggle the dark theme for the editor and the content?

this will not work:

  editor.mode.set.content_css("dark");
  editor.mode.set.skin("dark-oxide");
kolja
  • 505
  • 7
  • 24

1 Answers1

5

No, it is not possible. All the settings defined in the tinymce.init() function cannot be changed without reinitialization. However, reinitialization can be done very fast. You will need to perform 4 steps:

  1. Save current content somewhere with getContent()
  2. Destroy the TinyMCE instance with destroy()
  3. Reinitialize
  4. Use setContent() to add the content saved on step 1.
Dmitry D
  • 456
  • 3
  • 7