Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to disable the mobile UI features in tinyMCE 5

Tags:

mobile

tinymce

Is it possible to disable the mobile UI feature in tinyMCE, and just show the regular editor? I'm asking because it only shows a blank screen for me, in mobile (when I click on the "book" icon in the editor box. I've searched for solutions to the blank page and I only found vague references to "a parent element having overflow set to anything but visible" which didn't help me much.

like image 870
Gianluca Avatar asked Dec 18 '22 18:12

Gianluca


1 Answers

EDIT November 2019: TinyMCE 5.1 switches to the Silver theme by default on mobile devices. This workaround is no longer necessary.


Our documentation doesn't explicitly explain how to do this, and it isn't something we test so you may run into unexpected issues, but it is certainly possible.

Our mobile UI is implemented as a theme, even in TinyMCE 5, similar to how modern was our desktop theme for version 4 and silver is for version 5. By default when the editor detects it is on a mobile device the theme is set to mobile - we removed this from the v5 docs, but our v4 docs describe the defaults:

tinymce.init({
  selector: 'textarea',
  mobile: {
    theme: 'mobile'
  }
});

By extension of this concept, where the mobile block overrides the config, you can specify the mobile theme to be modern in TinyMCE 4, silver in TinyMCE 5 and the desktop interface will show:

tinymce.init({
  selector: 'textarea',
  mobile: {
    theme: 'silver'
  }
});

I have created a fiddle to demonstrate this which loads the desktop theme on my phone. http://fiddle.tinymce.com/C9gaab/1

like image 104
Spyder Avatar answered Dec 28 '22 06:12

Spyder