Ticket #1572: 1572.patch

File 1572.patch, 1.2 KB (added by Wiktor Walc, 12 years ago)
  • fckeditor.cfc

     
    112112        hint="Create a textarea field for non-compatible browsers."
    113113>
    114114        <cfset var result = "" />
     115        <cfset var sWidthCSS = "" />
     116        <cfset var sHeightCSS = "" />
    115117
    116118        <cfscript>
    117         // append unit "px" for numeric width and/or height values
    118         if( isNumeric( this.width ) )
    119                 this.width = this.width & "px";
    120         if( isNumeric( this.height ) )
    121                 this.height = this.height & "px";
    122         </cfscript>
     119        if( Find( "%", this.width ) gt 0)
     120                sWidthCSS = this.width;
     121        else
     122                sWidthCSS = this.width & "px";
    123123
    124         <cfscript>
    125         result = result & "<textarea name=""#this.instanceName#"" rows=""4"" cols=""40"" style=""WIDTH: #this.width#; HEIGHT: #this.height#"">#HTMLEditFormat(this.value)#</textarea>" & chr(13) & chr(10);
     124        if( Find( "%", this.width ) gt 0)
     125                sHeightCSS = this.height;
     126        else
     127                sHeightCSS = this.height & "px";
     128
     129        result = "<textarea name=""#this.instanceName#"" rows=""4"" cols=""40"" style=""width: #sWidthCSS#; height: #sHeightCSS#"">#HTMLEditFormat(this.value)#</textarea>" & chr(13) & chr(10);
    126130        </cfscript>
    127131        <cfreturn result />
    128132</cffunction>
© 2003 – 2019 CKSource – Frederico Knabben. All rights reserved. | Terms of use | Privacy policy