Ticket #4980: 4980.patch

File 4980.patch, 3.2 KB (added by Minh Nguyen, 14 years ago)

This bug also happen with hspace and vspace, too. The reason of problem is we have an error in case logic check variable with zero value.

  • _source/plugins/dialogui/plugin.js

     
    955955                                 */
    956956                                setValue : function( value )
    957957                                {
    958                                         value = value || '';
     958                                        value = ( value != null ) ? value : '';
    959959                                        return CKEDITOR.ui.dialog.uiElement.prototype.setValue.call( this, value );
    960960                                },
    961961
  • _source/plugins/image/dialogs/image.js

     
    800800                                                                                                                {
    801801                                                                                                                        var value,
    802802                                                                                                                                borderStyle = element.getStyle( 'border-width' );
    803 
    804803                                                                                                                        borderStyle = borderStyle && borderStyle.match( /^(\d+px)(?: \1 \1 \1)?$/ );
    805804                                                                                                                        value = borderStyle && parseInt( borderStyle[ 1 ], 10 );
    806                                                                                                                         !value && ( value = element.getAttribute( 'border' ) );
    807 
     805                                                                                                                        isNaN ( parseInt( value ) ) && ( value = element.getAttribute( 'border' ) );
    808806                                                                                                                        this.setValue( value );
    809807                                                                                                                }
    810808                                                                                                        },
     
    813811                                                                                                                var value = parseInt( this.getValue(), 10 );
    814812                                                                                                                if ( type == IMAGE || type == PREVIEW )
    815813                                                                                                                {
    816                                                                                                                         if ( value )
     814                                                                                                                        if ( !isNaN( value ) )
    817815                                                                                                                        {
    818816                                                                                                                                element.setStyle( 'border-width', CKEDITOR.tools.cssLength( value ) );
    819817                                                                                                                                element.setStyle( 'border-style', 'solid' );
     
    873871                                                                                                                        marginRightPx = parseInt( marginRightStyle, 10 );
    874872
    875873                                                                                                                        value = ( marginLeftPx == marginRightPx ) && marginLeftPx;
    876                                                                                                                         !value && ( value = element.getAttribute( 'hspace' ) );
     874                                                                                                                        isNaN( parseInt( value ) ) && ( value = element.getAttribute( 'hspace' ) );
    877875
    878876                                                                                                                        this.setValue( value );
    879877                                                                                                                }
     
    883881                                                                                                                var value = parseInt( this.getValue(), 10 );
    884882                                                                                                                if ( type == IMAGE || type == PREVIEW )
    885883                                                                                                                {
    886                                                                                                                         if ( value )
     884                                                                                                                        if ( !isNaN( value ) )
    887885                                                                                                                        {
    888886                                                                                                                                element.setStyle( 'margin-left', CKEDITOR.tools.cssLength( value ) );
    889887                                                                                                                                element.setStyle( 'margin-right', CKEDITOR.tools.cssLength( value ) );
     
    941939                                                                                                                        marginBottomPx = parseInt( marginBottomStyle, 10 );
    942940
    943941                                                                                                                        value = ( marginTopPx == marginBottomPx ) && marginTopPx;
    944                                                                                                                         !value && ( value = element.getAttribute( 'vspace' ) );
     942                                                                                                                        isNaN ( parseInt( value ) ) && ( value = element.getAttribute( 'vspace' ) );
    945943                                                                                                                        this.setValue( value );
    946944                                                                                                                }
    947945                                                                                                        },
     
    950948                                                                                                                var value = parseInt( this.getValue(), 10 );
    951949                                                                                                                if ( type == IMAGE || type == PREVIEW )
    952950                                                                                                                {
    953                                                                                                                         if ( value )
     951                                                                                                                        if ( !isNaN( value ) )
    954952                                                                                                                        {
    955953                                                                                                                                element.setStyle( 'margin-top', CKEDITOR.tools.cssLength( value ) );
    956954                                                                                                                                element.setStyle( 'margin-bottom', CKEDITOR.tools.cssLength( value ) );
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy