Completed
Last Updated: 08 Jan 2016 14:39 by ADMIN
ADMIN
Ianko
Created on: 04 Dec 2015 07:56
Category: Editor
Type: Bug Report
0
Content within iFrame tags is replicated when you switch b/w HTML and Design view in IE
You can workaround this issue by using this override:

<telerik:RadEditor runat="server" ID="RadEditor1">
    <Content>
        <br/>
        <iframe src="about:blank">Iframe not supported</iframe>
    </Content>
</telerik:RadEditor>

<script>
    Telerik.Web.UI.Editor.Utils._copyElementsBetweenNodes = function (oldNode, newNode, elementName)
    {
        var oldElements = oldNode.getElementsByTagName(elementName);
        var newElements = newNode.getElementsByTagName(elementName);
        for (var i = 0; i < oldElements.length; i++)
        {
            switch (elementName)
            {
                case "script":
                case "title":
                    newElements[i].text = oldElements[i].text;
                    break;
                case "style":
                    if (newElements[i].innerHTML != oldElements[i].innerHTML)
                    {
                        newElements[i].styleSheet.cssText = oldElements[i].styleSheet.cssText;
                    }
                    break;
                case "select":
                    newElements[i].selectedIndex = oldElements[i].selectedIndex;
                    break;
                case "input":
                    if ((oldElements[i].type == 'radio' || oldElements[i].type == 'checkbox') && $telerik.$(oldElements[i]).attr("checked"))
                    {
                        $telerik.$(newElements[i]).attr("checked", "checked");
                        if ($telerik.isIE9Mode && oldElements[i].type == 'checkbox' && oldElements[i].checked)
                        {
                            newElements[i].checked = true;
                            newElements[i].setAttribute("checked", "checked");
                        }
                    }
                    break;
                case "iframe":
                    var innerHTML = oldElements[i].innerHTML;
                    if (innerHTML)
                    {
                        var outerHTML = newElements[i].outerHTML;
                        if (outerHTML)
                        {
                            var gtIndex = outerHTML.indexOf(">");
                            if (gtIndex > 0)
                            {
                                outerHTML = outerHTML.substr(0, gtIndex) + ">" + innerHTML + outerHTML.substr(gtIndex + 1 + innerHTML.length);
                                newElements[i].outerHTML = outerHTML;
                            }
                        }
                    }
                    break;
                default:
                    if (newElements[i].innerHTML != oldElements[i].innerHTML)
                        $E.Utils.setElementInnerHtml(newElements[i], oldElements[i].innerHTML);
                    break;
            }
        }
    };
</script>
0 comments