Changeset 2280

Show
Ignore:
Timestamp:
2008-07-25 07:33:40 (6 months ago)
Author:
fredck
Message:

Fixed #2390 : Fixed the issue where indent styles in JavaScript-generated <p> blocks are erased in IE.

Location:
FCKeditor/trunk
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • FCKeditor/trunk/editor/_source/internals/fckxhtml_ie.js

    r1565 r2280  
    3030FCKXHtml._AppendAttributes = function( xmlNode, htmlNode, node, nodeName ) 
    3131{ 
    32         var aAttributes = htmlNode.attributes ; 
     32        var aAttributes = htmlNode.attributes, 
     33                bHasStyle ; 
    3334 
    3435        for ( var n = 0 ; n < aAttributes.length ; n++ ) 
     
    4849                        else if ( sAttName == 'style' ) 
    4950                        { 
    50                                 var data = FCKTools.ProtectFormStyles( htmlNode ) ; 
    51                                 sAttValue = htmlNode.style.cssText.replace( FCKRegexLib.StyleProperties, FCKTools.ToLowerCase ) ; 
    52                                 FCKTools.RestoreFormStyles( htmlNode, data ) ; 
     51                                // Just mark it to do it later in this function. 
     52                                bHasStyle = true ; 
     53                                continue ; 
    5354                        } 
    5455                        // There are two cases when the oAttribute.nodeValue must be used: 
     
    8182                } 
    8283        } 
     84 
     85        // IE loses the style attribute in JavaScript-created elements tags. (#2390)  
     86        if ( bHasStyle || htmlNode.style.cssText.length > 0 ) 
     87        { 
     88                var data = FCKTools.ProtectFormStyles( htmlNode ) ; 
     89                var sStyleValue = htmlNode.style.cssText.replace( FCKRegexLib.StyleProperties, FCKTools.ToLowerCase ) ; 
     90                FCKTools.RestoreFormStyles( htmlNode, data ) ; 
     91                this._AppendAttribute( node, 'style', sStyleValue ) ; 
     92        } 
    8393} 
    8494 
  • FCKeditor/trunk/_whatsnew.html

    r2279 r2280  
    108108                <li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2387">#2387</a>] Fixed JavaScript 
    109109                        with list commands when the editable document is selected with Ctrl-A.</li> 
     110                <li>[<a target="_blank" href="http://dev.fckeditor.net/ticket/2390">#2390</a>] Fixed the issue where  
     111                        indent styles in JavaScript-generated &lt;p&gt; blocks are erased in IE.</li>  
    110112        </ul> 
    111113        <p>