This is a migrated thread and some comments may be shown as answers.
RadWindow, Content Template, & Chrome
2 Answers 35 Views
This is a migrated thread and some comments may be shown as answers.
Hunter
Top achievements
Rank 1
Hunter asked on 01 May 2012, 10:07 PM
Hello, I have a radEditor which is located within the content template of a radWindow. This radWindow is displayed to a user using the radWindow's VisibleOnPageLoad property (server side). I've added a handler for the OnClientShow event of the radWindow and in it I call the editor's onParentNodeChanged method. Everything works as expected in IE and FF. Chrome users, however, get the window and the editor but are unable to type anything in the content area. I can click the buttons in the toolbar cannot type in the content area. I went ahead and enabled the HTML edit mode and when I chose this mode I was able to type in the content area but when I switched back to the Design mode (default) there was no text in the content area. I'm not sure what I'm missing? I am on the latest build of Telerik. Thanks.

2 Answers, 1 is accepted

Sort by
0
Accepted
Marin Bratanov
Telerik team
answered on 02 May 2012, 04:13 PM
Hello Hunter,

We have seen a problem under Chrome in this scenario where the iframe of the RadEditor is considered unsafe by Chrome and its scripts throw a JavaScript errors, which is the reason why things are not working.

I am attaching here a simple page that functions properly on my end and I believe it will with you as well./ The essence is the following function override that needs to be placed just before the closing form tag:
var $T = Telerik.Web.UI;
$T.RadEditor.prototype.toggleEnhancedEdit = function (newValue)
{
    if (this.get_contentAreaMode() == $T.EditorContentAreaMode.Div)
    {
        var conentArea = this.get_contentArea();
        if (typeof (newValue) == "undefined" || null == newValue)
            newValue = (conentArea.className.indexOf("reContentAreaToggle") > -1) ? false : true;
 
        if (newValue)
            Sys.UI.DomElement.addCssClass(conentArea, "reContentAreaToggle");
        else
            Sys.UI.DomElement.removeCssClass(conentArea, "reContentAreaToggle");
 
        this.updateToggleTableBorderToolState(newValue);
        return newValue;
    }
    else
    {
        if ($telerik.isSafari && !$telerik.isChrome && typeof (newValue) != "undefined" && false == this.disableContentAreaStylesheet(newValue))
        {
            this.get_contentWindow().setTimeout(Function.createDelegate(this, function ()
            {
                this.disableContentAreaStylesheet(newValue);
            }), 200);
        }
        else
        {
            return this.disableContentAreaStylesheet(newValue);
        }
    }
}



Greetings,
Marin
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
0
Hunter
Top achievements
Rank 1
answered on 02 May 2012, 05:46 PM
Magic! Everything works correctly now. Appreciate the help.
Asked by
Hunter
Top achievements
Rank 1
Answers by
Marin Bratanov
Telerik team
Hunter
Top achievements
Rank 1
Share this question
or