簡體   English   中英

TinyMCE未在IE11中選擇元素

[英]TinyMCE is not selecting elements in IE11

我已經為TinyMCE編寫了一個插件,它將用其屬性生成的內容替換自身。 在Chrome和FF中,這可以正常工作,但是在IE11中,則無法工作。

當我處理文檔以查找自定義標記並將其替換為生成的內容時,將使用editor.selection.select(element) 這無法選擇IE11中的元素。

JSFiddle: https ://jsfiddle.net/bpstoxin/bsz69zcv/1/

代碼節選

            tinymce.each(editor.dom.select(tagName, node), function(element) {
                if (element.parentNode) {
                    editor.selection.select(element);
                    editor.selection.setContent(element.getAttribute('data-contents'));
                }
            });

由於未選擇元素,因此將內容插入文檔的頂部,而不是替換我的自定義標簽。

這是TinyMce的錯誤,還是我做錯了什么? 請記住,這是我插件的縮小版本,以演示該問題。

我不明白您為什么在這種情況下使用選擇項,請嘗試此操作。

    tinymce.each(editor.dom.select(tagName, node), function(element) {
      if (element.parentNode) {
          // BUG: For some reason, this is failing in IE 11
          var dataContent = element.getAttribute('data-contents');
          element.outerHTML = dataContent.toString();
       }
    });

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM