Opened 13 years ago
Last modified 13 years ago
#10052 confirmed Bug
Image dialog - preview do not refresh when field is cleared
| Reported by: | Gael | Owned by: | |
|---|---|---|---|
| Priority: | Normal | Milestone: | |
| Component: | UI : Dialogs | Version: | 3.0.2 |
| Keywords: | Cc: |
Description
The preview window in the image dialog do not clear the CSS attribute when the value is cleared:
- Insert an image in CKEditor.
- Right click on the image and open the image dialiog.
- Enter a border of 9. The preview image show a border of 9px.
- Clear the border field (erase the number 9 from the field). The preview image still show a border of 9px.
Affect: Border, HSpace VSpace, etc.
I notice the following in the code:
File: _source/plugins/image/dialogs/image.js
Line: 848
if ( !isNaN( value ) )
{
element.setStyle( 'border-width', CKEDITOR.tools.cssLength( value ) );
element.setStyle( 'border-style', 'solid' );
}
else if ( !value && this.isChanged() )
element.removeStyle( 'border' );
I don't understand why it check if the field has been changed before removing the style, but if I remove that check, it works as expected:
if ( !isNaN( value ) )
{
element.setStyle( 'border-width', CKEDITOR.tools.cssLength( value ) );
element.setStyle( 'border-style', 'solid' );
}
else if ( !value )
element.removeStyle( 'border' );
Change History (1)
comment:1 Changed 13 years ago by
| Status: | new → confirmed |
|---|---|
| Version: | 4.0.2 (GitHub - master) → 3.0.2 |

Problem can be reproduced in all browsers from CKEditor 3.0.2.