Completed
Last Updated: 01 Sep 2014 09:50 by ADMIN
ADMIN
Nikolay
Created on: 29 Aug 2014 12:15
Category: Editor
Type: Bug Report
0
RadEditor placed in a RadWindow does not apply its styles to the content area in Firefox
Steps to reproduce:

1. Create StyleSheet.css file containing the following style:
 p { color: red; }

2. Set the following markup:

<telerik:RadWindow ID="RadWindow1" runat="server" VisibleOnPageLoad="true">
            <ContentTemplate>
                        <telerik:RadEditor ID="RadEditor1" runat="server">
                                    <CssFiles>
                                                <telerik:EditorCssFile Value="StyleSheet.css" />
                                    </CssFiles>
                                    <Content>
                                                <p>test</p>
						<p>test</p>
                                    </Content>
                        </telerik:RadEditor>
            </ContentTemplate>
</telerik:RadWindow>

3. Make sure RadEditor's EditorCssFile property points to the created StyleSheet.css file

Result: The red color is not applied to the paragraphs in the content area.


Workaround:
<script>
	(function (utils) {
		var addStyleSheet = utils.addStyleSheet;
		utils.addStyleSheet = function (url, doc, id) {
			if ($telerik.isFirefox) {
				if (!url) return;
				doc = doc || document;
				var link = doc.createElement("link");
				link.setAttribute("href", url, 0);
				link.setAttribute("type", "text/css");
				link.setAttribute("rel", "stylesheet", 0);
				if (id) link.setAttribute("id", id);

				var headElement = doc.getElementsByTagName("head")[0];
				var addSheet = function () { headElement.appendChild(link); };
				window.setTimeout(addSheet, 200);
			}
			else {
				addStyleSheet.call(this, url, doc, id);
			}
		}
	})(Telerik.Web.UI.Editor.Utils);
</script>
0 comments