Ticket #9381: 9381.patch

File 9381.patch, 2.7 KB (added by Garry Yao, 12 years ago)
  • _source/plugins/image/dialogs/image.js

    IDEA additional info:
    Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
    <+>UTF-8
     
    846846                                                                                                                                element.setStyle( 'border-style', 'solid' );
    847847                                                                                                                        }
    848848                                                                                                                        else if ( !value && this.isChanged() )
    849                                                                                                                         {
    850                                                                                                                                 element.removeStyle( 'border-width' );
    851                                                                                                                                 element.removeStyle( 'border-style' );
    852                                                                                                                                 element.removeStyle( 'border-color' );
    853                                                                                                                         }
     849                                                                                                                                element.removeStyle( 'border' );
    854850
    855851                                                                                                                        if ( !internalCommit && type == IMAGE )
    856852                                                                                                                                element.removeAttribute( 'border' );
  • _source/core/dom/element.js

    IDEA additional info:
    Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
    <+>UTF-8
     
    105105        }
    106106};
    107107
     108( function()
     109{
     110
    108111CKEDITOR.tools.extend( CKEDITOR.dom.element.prototype,
    109112        /** @lends CKEDITOR.dom.element.prototype */
    110113        {
     
    11891192                {
    11901193                        // Removes the specified property from the current style object.
    11911194                        var $ = this.$.style;
     1195
     1196                        // "removeProperty" need to be specific on the following styles.
     1197                        if ( !$.removeProperty && ( name == 'border' || name == 'margin' || name == 'padding' ) )
     1198                        {
     1199                                var names = specificRules( name );
     1200                                for ( var i = 0 ; i < names.length ; i++ ) {
     1201                                        this.removeStyle( names[ i ] );
     1202                                }
     1203                                return;
     1204                        }
     1205
    11921206                        $.removeProperty ? $.removeProperty( name ) : $.removeAttribute( CKEDITOR.tools.cssStyleToDomStyle( name ) );
    11931207
    11941208                        if ( !this.$.style.cssText )
     
    17551769                }
    17561770        });
    17571771
    1758 ( function()
    1759 {
    17601772        var sides = {
    17611773                width : [ "border-left-width", "border-right-width","padding-left", "padding-right" ],
    17621774                height : [ "border-top-width", "border-bottom-width", "padding-top",  "padding-bottom" ]
    17631775        };
     1776
     1777        // Generate list of specific style rules, applicable to margin/padding/border.
     1778        function specificRules( style ) {
     1779                var sides = [ 'top', 'left', 'right', 'bottom' ], components;
     1780
     1781                switch ( style ) {
     1782                        case 'border' :
     1783                                components = [ 'color', 'style', 'width' ];
     1784                }
     1785
     1786                var styles = [];
     1787                for ( var i = 0 ; i < sides.length ; i++ ) {
     1788
     1789                        if ( components )
     1790                        {
     1791                                for ( var j = 0 ; j < components.length ; j++) {
     1792                                        styles.push( [ style, sides[ i ], components[j] ].join( '-' ) );
     1793                                }
     1794                        }
     1795                        else
     1796                                styles.push( [ style, sides[ i ] ].join( '-' ) );
     1797                }
     1798
     1799                return styles;
     1800        }
    17641801
    17651802        function marginAndPaddingSize( type )
    17661803        {
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy