Ticket #5353: 5353.patch

File 5353.patch, 2.4 KB (added by Garry Yao, 14 years ago)
  • _source/core/dom/element.js

     
    14371437                                        if ( !event.data.getTarget().hasClass( 'cke_enable_context_menu' ) )
    14381438                                                event.data.preventDefault();
    14391439                                } );
    1440                 }
     1440                },
     1441
     1442                /**
     1443                 *  Update the element's size with box model awareness.
     1444                 * @name CKEDITOR.dom.element.setSize
     1445                 * @param {String} type [width|height]
     1446                 * @param {Number} size The length unit in px.
     1447                 * @param isBorderBox Apply the {@param width} and {@param height} based on border box model.
     1448                 */
     1449                setSize : ( function()
     1450                {
     1451                        var sides = {
     1452                                width : [ "border-left-width", "border-right-width","padding-left", "padding-right" ],
     1453                                height : [ "border-top-width", "border-bottom-width", "padding-top",  "padding-bottom" ]
     1454                        };
     1455
     1456                        return function( type, size, isBorderBox )
     1457                        {
     1458                                if ( typeof size == 'number' )
     1459                                {
     1460                                        if ( isBorderBox && !( CKEDITOR.env.ie && CKEDITOR.env.quirks ) )
     1461                                        {
     1462                                                var     adjustment = 0;
     1463                                                for ( var i = 0, len = sides [ type ].length; i < len; i++ )
     1464                                                        adjustment += parseInt( this.getComputedStyle( sides [ type ][ i ] ) || 0, 10 );
     1465                                                size -= adjustment;
     1466                                        }
     1467                                        this.setStyle( type, size + 'px' );
     1468                                }
     1469                        }
     1470                })()
    14411471        });
  • _source/themes/default/theme.js

     
    275275
    276276CKEDITOR.editor.prototype.resize = function( width, height, isContentHeight, resizeInner )
    277277{
    278         var numberRegex = /^\d+$/;
    279         if ( numberRegex.test( width ) )
    280                 width += 'px';
    281 
    282278        var container = this.container,
    283279                contents = CKEDITOR.document.getById( 'cke_contents_' + this.name ),
    284280                outer = resizeInner ? container.getChild( 1 ) : container;
     
    287283        // WEBKIT BUG: Webkit requires that we put the editor off from display when we
    288284        // resize it. If we don't, the browser crashes!
    289285        CKEDITOR.env.webkit && outer.setStyle( 'display', 'none' );
    290         outer.setStyle( 'width', width );
     286        // Set as border box width. (#5353)
     287        outer.setSize( 'width',  width, true );
    291288        if ( CKEDITOR.env.webkit )
    292289        {
    293290                outer.$.offsetWidth;
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy