JQuery模式中的TinyMCE模态不可编辑 [英] TinyMCE modal in JQuery modal not editable

查看:80
本文介绍了JQuery模式中的TinyMCE模态不可编辑的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在JQuery UI模式对话框中运行一个tinyMCE编辑器。一切都运行正常,除了那些本身打开一个新模态(例如链接)的tinyMCE的功能。这些模态显示正常,但输入区域不可编辑。
根据Firebug,js代码是可以的,HTML非常简单。

I am running a tinyMCE editor inside a JQuery UI modal dialog. Everything works fine, except for those functions of tinyMCE which themselves open a new modal (links, for example). These modals are displayed fine but the input areas are not editable. The js code is OK according to Firebug and the HTML is pretty straightforward.

任何可能来自哪里的线索?

Any clue where it might come from?

编辑:

<script type="text/javascript">
tinymce.init({
    selector: "textarea",
    plugins: "autolink link table textcolor",
    menubar: false,
    toolbar: "undo redo | styleselect | forecolor backcolor | bold italic | link unlink | table"
});
$(document).ready(function(){
    $(".sendmail")
        .button({
            icons: {
                primary: "ui-icon-mail-closed"
            },
            text: false
        })
        .click(function(){
            $("#sendmailform").dialog("open");
        })
    ;
    $(function(){
        $("#sendmailform")
            .dialog({
                autoOpen: false,
                title: "Send mail confirmation",
                modal:true,
                width: 750,
                [buttons & ajax]
            })
        ;
    });
});
</script>


推荐答案

感谢@Harry,TinyMCE上的伟大人物bugtracker提供了解决方案。

Thanks to @Harry, the great guys on the TinyMCE bugtracker provided the solution.

我刚刚在DOM之后加载的脚本之前添加了以下代码,就在加载tinyMCE之前:

I just added the code below on top of my script loaded after the DOM, just before loading tinyMCE:

$(document).on('focusin', function(e) {
    if ($(event.target).closest(".mce-window").length) {
        e.stopImmediatePropagation();
    }
});

像魅力一样,而@Harry发布的那个没有。

Works like a charm, while the one posted by @Harry did not.

这篇关于JQuery模式中的TinyMCE模态不可编辑的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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