Opened 16 years ago

Closed 16 years ago

#1572 closed Bug (fixed)

CF: Height parameter for editor instance is not working

Reported by: Roos Eisma Owned by: Wiktor Walc
Priority: Normal Milestone: FCKeditor 2.6
Component: Server : ColdFusion Version:
Keywords: Confirmed Review+ Cc:

Description

I recently upgraded FCKeditor from 2.1 to 2.5 in our ColdFusion application. Both in Firefox and MSIE the height of the edit area did not respond to the value set for height. I compared the HTML generated by the old installation and noticed that it used: style="width: 95%; height: 600px;" in the IFrame tag. while the 2.5 version generated HTML with width="95%" height="600px". I tried various variations using % or px or just a number but it didn't respond. I then changed the code in fckeditor.cfc to use the style attribute and now it is working again.

Attachments (1)

1572.patch (1.2 KB) - added by Wiktor Walc 16 years ago.

Download all attachments as: .zip

Change History (8)

comment:1 Changed 16 years ago by Frederico Caldeira Knabben

Looking at the CFC file, we can see that the height is outputted in this way:

height=""#this.height#""

So, the current height value is simply put there as is.

It is important to not include units when setting the height value. So, just use "600", not "600px".

In the other hand, the following code is wrong in the "getTextArea" function:

	<cfscript>
	// append unit "px" for numeric width and/or height values
	if( isNumeric( this.width ) )
		this.width = this.width & "px";
	if( isNumeric( this.height ) )
		this.height = this.height & "px";
	</cfscript>

I don't think it is related to the reported bug, as it will be called when rendering the textarea only, but it is changing the "width" and "height" values for the object instance, while a temporary variable should be used instead. Something like this:

	<cfscript>
	width = this.width;
	height = this.height;
	// append unit "px" for numeric width and/or height values
	if( isNumeric( width ) )
		width = width & "px";
	if( isNumeric( height ) )
		height = height & "px";
	</cfscript>

And then "width" and "height" should be used in the textarea rendering.

comment:2 Changed 16 years ago by Frederico Caldeira Knabben

Component: GeneralServer : ColdFusion
Milestone: FCKeditor 2.6
Summary: height parameter for edit area only works using the style tag (Coldfusion, FF&MSIE)CF: Height parameter for editor instance is not working

comment:3 in reply to:  description Changed 16 years ago by Roos Eisma

Replying to reisma:

Update: I thought it might have to do with the context in which the editor is used - it is inside various divs and tables with attached styles etcetera (I didn't make the original application). Looking through the main stylesheet for the page I found: iframe {

various other settings height: 200px;

}

So it looks like the style attribute in the FCKeditor iframe is able to override this setting, but the plain height="x" attribute isn't.

Roos

comment:4 Changed 16 years ago by Wojciech Olchawa

Keywords: Confirmed added

Changed 16 years ago by Wiktor Walc

Attachment: 1572.patch added

comment:5 Changed 16 years ago by Wiktor Walc

Keywords: Review? added
Owner: set to Wiktor Walc

comment:6 Changed 16 years ago by Frederico Caldeira Knabben

Keywords: Review+ added; Review? removed

Please include the changelog when committing.

comment:7 Changed 16 years ago by Wiktor Walc

Resolution: fixed
Status: newclosed

Fixed with [1581].

Note: See TracTickets for help on using tickets.
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy