【问题标题】:tinymce- customize tinyMCEPopup.closetinymce - 自定义 tinyMCEPopup.close
【发布时间】:2012-06-13 06:26:59
【问题描述】:

我为 tinymce 开发了一个自定义文件管理器。但是即使在firefox中向tinymce添加图像有效,它也不能在ie中使用以下代码块。

 tinyMCE.activeEditor.selection.setContent("<img src='" + $(this).attr("data-url") + "' style='width:150px; height:150px;' />");

在 Internet Explorer 中,由于 "tinyMCE.activeEditor.selection" 为空,它会删除 tinymce 中的所有内容并添加图像。关于这一点,我发现了以下帖子。 What's the best way to set cursor/caret position?

但在用户打开文件管理器弹出窗口后,她/他可能想在不添加文件的情​​况下关闭它。如果发生这种情况,我应该删除我为光标/插入符号位置添加的 html,以便在 ie 中找到以后的选择。

我尝试添加一个点击事件来关闭弹出窗口的链接,但是它不起作用。我需要感知弹出关闭并对其进行自定义。

【问题讨论】:

    标签: jquery internet-explorer popup tinymce


    【解决方案1】:

    使用此代码,我可以删除插入符号 html。

     $($(parent.document).find("a.mceClose")[0]).mousedown(function () {
                    if ($.browser.msie) {
                        var ed = tinyMCE.activeEditor;
                        var html = $(ed.dom.select('div#filemanager_wrapper')[0]).html();
                        $(ed.dom.select('div#filemanager_wrapper')[0]).replaceWith(html)
                    }
    
                });
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-11-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-01-03
      相关资源
      最近更新 更多