是否可以在tinyMCE 5中禁用移动UI功能 [英] Is it possible to disable the mobile UI features in tinyMCE 5

查看:87
本文介绍了是否可以在tinyMCE 5中禁用移动UI功能的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以在tinyMCE中禁用移动UI功能,而只显示常规编辑器? 我之所以问是因为它只在移动设备上为我显示一个空白屏幕(当我单击编辑器框中的书本"图标时. 我一直在寻找空白页的解决方案,但是我发现模糊的引用对父元素的溢出设置为可见的任何东西"并没有多大帮助.

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.

推荐答案

EDIT 2019年11月:TinyMCE 5.1默认在移动设备上切换为Silver主题.不再需要这种解决方法.

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.

即使在TinyMCE 5中,我们的移动用户界面也是作为主题实现的,类似于modern是我们的版本4的桌面主题,而silver是版本5的主题.设备,将主题设置为mobile-我们从v5文档中删除了此主题,但是我们的v4文档描述了默认值:

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'
  }
});

通过这个概念的扩展,在移动块覆盖配置的情况下,您可以在TinyMCE 4中将移动主题指定为modern,在TinyMCE 5中将移动主题指定为silver,并且桌面界面将显示:

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'
  }
});

我创建了一个小提琴来演示此操作,该操作将桌面主题加载到手机上. http://fiddle.tinymce.com/C9gaab/1

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

这篇关于是否可以在tinyMCE 5中禁用移动UI功能的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆