Ticket #2390: 2390_2.patch

File 2390_2.patch, 2.3 KB (added by fredck, 20 months ago)
  • _whatsnew.html

     
    107107                        source logic for comments in IE.</li> 
    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> 
    112114                <a href="_whatsnew_history.html">See previous versions history</a></p> 
  • editor/_source/internals/fckxhtml_ie.js

     
    2929 
    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++ ) 
    3536        { 
     
    4748                        // attribute. It returns "null" for the nodeValue. 
    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: 
    5556                        //              - for the "class" attribute 
     
    8081                        this._AppendAttribute( node, sAttName, sAttValue || oAttribute.nodeValue ) ; 
    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 
    8595// On very rare cases, IE is loosing the "align" attribute for DIV. (right align and apply bulleted list)