TinyMCE 4无法输入提供的插件文本字段 [英] TinyMCE 4 can't type in provided plugin text fields

查看:616
本文介绍了TinyMCE 4无法输入提供的插件文本字段的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在JS(使用JQuery 1.11.1和几个JQuery插件,如form和ui)下使用TinyMCE 4.1.5。我正在使用的TinyMCE版本不是嵌入式JQuery的版本。

Using TinyMCE 4.1.5 under JS (w/ JQuery 1.11.1 and several JQuery plugins like form and ui). The TinyMCE version I'm using is not the one with embedded JQuery.

编辑器出现正常,我可以直接输入它而不会出现问题。仅使用tinymce提供的插件,所有使用按钮或非文本字段控件的函数都可以正常工作。

The editor comes up fine and I can type directly in it without issue. Using only the tinymce-provided plugins, all functions that use buttons or non-text field controls work fine.

然而,插件中的文本字段(例如链接中)或插入视频)不允许我输入字段或选择其他文本字段(因此它似乎是焦点问题)。

However, the text fields in the plugins (such as in link or insert video) won't let me type into the fields or select other text fields (so it seems like a focus issue).

http://fiddle.tinymce.com/bzeaab/16 ,这是一个更具体的初始化代码来自于应用程序:

There's a fiddle at http://fiddle.tinymce.com/bzeaab/16, and here's a more specific init code from in the application:

var _clear_css_cache;
_clear_css_cache = '/javascripts/canonical/tinymce/skins/lightgray/' +
                   'content.min.css?' +
                   new Date().getTime();

var _toolbar_1, _toolbar_2;
_toolbar_1 = 'formatselect, |, ' +
             'bold, italic, underline, strikethrough, ' +
                'subscript, superscript, |,' +
             'outdent, indent, blockquote, |,' +
             'alignleft, aligncenter, alignright, alignjustify';

_toolbar_2 = 'bullist, numlist, table, charmap, emoticons |,' +
             'link, unlink, |,' +
             'image, media, |,' +
             'code, preview |,' +
             'pasteword, print |,' +
             'undo, redo,';

var _contextmenu;
_contextmenu = 'link image inserttable | ' +
               'cell row column deletetable';

tinymce.init({
  selector: 'textarea.tinymce',
  toolbar: [_toolbar_1, _toolbar_2],
  plugins: [
    'advlist autolink autosave code charmap contextmenu emoticons image', 
    'lists link media paste preview print table'
  ],
  contextmenu: _contextmenu,
  theme: 'modern',
  content_css: _clear_css_cache,
  menubar: false,
  statusbar: false,
  convert_urls: false,
  relative_urls: false,
  invalid_elements: 'script'
});

要插入目标div(带有'textarea.tinymce'的子项),我使用了非常标准的电话:

And to insert into target div (with a child of 'textarea.tinymce'), I use a pretty standard call:

function do_wysiwyg(_div) {
  tinymce.execCommand('mceAddEditor', true, $(_div).attr('id'));
});

我在本地和BrowserStack尝试了几种浏览器,并且没有一个插件文本字段可以在任何他们,即使编辑也这样做。

I've tried several browsers local and in BrowserStack and none of the plugin text fields work in any of them, even though the editor does.

参见使用tinymce with blockui

想法?提前致谢。

更新(2014年10月7日):想知道z-index是否在干扰,但到目前为止没有运气实验。这是一个非常古老的tinymce安装的升级,插件在那里运行良好,所以期望在tinymce代码/调用本身之外没有转换。

UPDATE (10/7/2014): Was wondering if a z-index is interfering but so far no luck during experimentation. This is an upgrade from a very old tinymce install and the plugins worked fine there, so was expecting no conversion outside of tinymce code/invocation itself.

更新2 (2014年10月7日):现在有一个小提琴: http://fiddle.tinymce的.com / bzeaab / 16 。似乎只在使用BlockUI时才会出现!我打赌现在有一个来自BlockUI的焦点陷阱。

UPDATE 2 (10/7/2014): have a fiddle now: http://fiddle.tinymce.com/bzeaab/16. Appears to only occur when using BlockUI ! Am betting that there's a focus trap from BlockUI now.

推荐答案

似乎有效的一个解决方案是传递 bindEvents = false 作为选项(以及 msg 等,请参阅 http://fiddle.tinymce.com/bzeaab/17 了解原始小提琴( http://fiddle.tinymce.com/bzeaab/16 )进行了修改,允许插件工作。

One solution that seems to work is to pass bindEvents = false in the .blockUI call as an option (along with msg, etc. See http://fiddle.tinymce.com/bzeaab/17 for how original fiddle (http://fiddle.tinymce.com/bzeaab/16) was amended to allow the plug in to work.

我担心的是这种方法解除了blockUI覆盖中的所有内容,而不仅仅是tinymce插件,所以可能太过分了。

My concern is that this approach unbinds everything in the blockUI overlay, not just tinymce plugins, so may be too overreaching.

请评论或发布不同的内容如果你有更好的建议,请回答。在其他人有机会权衡之前,我不会接受这个答案。谢谢!

Please comment or post a different answer if you have better advice than this. I won't accept this as the answer until others have a chance to weigh in. Thanks!

这篇关于TinyMCE 4无法输入提供的插件文本字段的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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