Index: _whatsnew.html
===================================================================
--- _whatsnew.html (revision 2274)
+++ _whatsnew.html (working copy)
@@ -107,6 +107,8 @@
source logic for comments in IE.
[#2387] Fixed JavaScript
with list commands when the editable document is selected with Ctrl-A.
+ [#2390] Fixed the issue where
+ indent styles in JavaScript-generated <p> blocks are erased in IE.
See previous versions history
Index: editor/_source/internals/fckxhtml_ie.js
===================================================================
--- editor/_source/internals/fckxhtml_ie.js (revision 2274)
+++ editor/_source/internals/fckxhtml_ie.js (working copy)
@@ -29,7 +29,8 @@
FCKXHtml._AppendAttributes = function( xmlNode, htmlNode, node, nodeName )
{
- var aAttributes = htmlNode.attributes ;
+ var aAttributes = htmlNode.attributes,
+ bHasStyle ;
for ( var n = 0 ; n < aAttributes.length ; n++ )
{
@@ -47,9 +48,9 @@
// attribute. It returns "null" for the nodeValue.
else if ( sAttName == 'style' )
{
- var data = FCKTools.ProtectFormStyles( htmlNode ) ;
- sAttValue = htmlNode.style.cssText.replace( FCKRegexLib.StyleProperties, FCKTools.ToLowerCase ) ;
- FCKTools.RestoreFormStyles( htmlNode, data ) ;
+ // Just mark it to do it later in this function.
+ bHasStyle = true ;
+ continue ;
}
// There are two cases when the oAttribute.nodeValue must be used:
// - for the "class" attribute
@@ -80,6 +81,15 @@
this._AppendAttribute( node, sAttName, sAttValue || oAttribute.nodeValue ) ;
}
}
+
+ // IE loses the style attribute in JavaScript-created elements tags. (#2390)
+ if ( bHasStyle || htmlNode.style.cssText.length > 0 )
+ {
+ var data = FCKTools.ProtectFormStyles( htmlNode ) ;
+ var sStyleValue = htmlNode.style.cssText.replace( FCKRegexLib.StyleProperties, FCKTools.ToLowerCase ) ;
+ FCKTools.RestoreFormStyles( htmlNode, data ) ;
+ this._AppendAttribute( node, 'style', sStyleValue ) ;
+ }
}
// On very rare cases, IE is loosing the "align" attribute for DIV. (right align and apply bulleted list)