Ticket #5547: image-width-and-height-attributes.diff

File image-width-and-height-attributes.diff, 3.3 KB (added by Pivotal Labs, 12 years ago)

Patch to include width and height attributes on images added

  • _source/plugins/image/dialogs/image.js

     
    661661                                                                                                                                var value = this.getValue();
    662662                                                                                                                                if ( type == IMAGE )
    663663                                                                                                                                {
    664                                                                                                                                         if ( value )
     664                                                                                                                                        if ( value ) {
    665665                                                                                                                                                element.setStyle( 'width', CKEDITOR.tools.cssLength( value ) );
    666                                                                                                                                         else
     666                                                                                                                                                element.setAttribute( 'width', value );
     667                                  } else {
    667668                                                                                                                                                element.removeStyle( 'width' );
    668 
    669                                                                                                                                         !internalCommit && element.removeAttribute( 'width' );
     669                                                                                                                                                element.removeAttribute( 'width' );
     670                                  }
    670671                                                                                                                                }
    671672                                                                                                                                else if ( type == PREVIEW )
    672673                                                                                                                                {
     
    674675                                                                                                                                        if ( !aMatch )
    675676                                                                                                                                        {
    676677                                                                                                                                                var oImageOriginal = this.getDialog().originalElement;
    677                                                                                                                                                 if ( oImageOriginal.getCustomData( 'isReady' ) == 'true' )
     678                                                                                                                                                if ( oImageOriginal.getCustomData( 'isReady' ) == 'true' ) {
    678679                                                                                                                                                        element.setStyle( 'width',  oImageOriginal.$.width + 'px');
     680                                                                                                                                                        element.setAttribute( 'width',  oImageOriginal.$.width );
     681                                    }
    679682                                                                                                                                        }
    680                                                                                                                                         else
     683                                                                                                                                        else {
    681684                                                                                                                                                element.setStyle( 'width', CKEDITOR.tools.cssLength( value ) );
     685                                                                                                                                                element.setAttribute( 'width', value );
     686                                  }
    682687                                                                                                                                }
    683688                                                                                                                                else if ( type == CLEANUP )
    684689                                                                                                                                {
     
    711716                                                                                                                                var value = this.getValue();
    712717                                                                                                                                if ( type == IMAGE )
    713718                                                                                                                                {
    714                                                                                                                                         if ( value )
     719                                                                                                                                        if ( value ) {
    715720                                                                                                                                                element.setStyle( 'height', CKEDITOR.tools.cssLength( value ) );
    716                                                                                                                                         else
     721                                                                                                                                                element.setAttribute( 'height', value );
     722                                  } else {
    717723                                                                                                                                                element.removeStyle( 'height' );
    718 
    719                                                                                                                                         !internalCommit && element.removeAttribute( 'height' );
     724                                                                                                                                                element.removeAttribute( 'height' );
     725                                  }
    720726                                                                                                                                }
    721727                                                                                                                                else if ( type == PREVIEW )
    722728                                                                                                                                {
     
    724730                                                                                                                                        if ( !aMatch )
    725731                                                                                                                                        {
    726732                                                                                                                                                var oImageOriginal = this.getDialog().originalElement;
    727                                                                                                                                                 if ( oImageOriginal.getCustomData( 'isReady' ) == 'true' )
     733                                                                                                                                                if ( oImageOriginal.getCustomData( 'isReady' ) == 'true' ) {
    728734                                                                                                                                                        element.setStyle( 'height', oImageOriginal.$.height + 'px' );
     735                                                                                                                                                        element.setAttribute( 'height', oImageOriginal.$.height );
     736                                    }
    729737                                                                                                                                        }
    730                                                                                                                                         else
     738                                                                                                                                        else {
    731739                                                                                                                                                element.setStyle( 'height',  CKEDITOR.tools.cssLength( value ) );
     740                                                                                                                                                element.setAttribute( 'height', value );
     741                                  }
    732742                                                                                                                                }
    733743                                                                                                                                else if ( type == CLEANUP )
    734744                                                                                                                                {
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy