Ticket #3576: 3576_3.patch
File 3576_3.patch, 1.9 KB (added by , 14 years ago) |
---|
-
_source/plugins/styles/plugin.js
895 895 function removeFromElement( style, element ) 896 896 { 897 897 var def = style._.definition, 898 attributes = def.attributes,898 attributes = CKEDITOR.tools.extend( {}, def.attributes, getOverrides( style )[ element.getName() ] ), 899 899 styles = def.styles, 900 overrides = getOverrides( style ); 900 // If the style is only about the element itself, we have to remove the element. 901 removeEmpty = CKEDITOR.tools.isEmpty( attributes ) && CKEDITOR.tools.isEmpty( styles ); 901 902 902 function removeAttrs() 903 { 904 for ( var attName in attributes ) 905 { 906 // The 'class' element value must match (#1318). 907 if ( attName == 'class' && element.getAttribute( attName ) != attributes[ attName ] ) 908 continue; 909 element.removeAttribute( attName ); 910 } 911 } 903 // Remove definition attributes/style from the elemnt. 904 for ( var attName in attributes ) 905 { 906 // The 'class' element value must match (#1318). 907 if ( attName == 'class' && element.getAttribute( attName ) != attributes[ attName ] ) 908 continue; 909 removeEmpty = element.hasAttribute( attName ); 910 element.removeAttribute( attName ); 911 } 912 912 913 // Remove definition attributes/style from the elemnt.914 removeAttrs();915 913 for ( var styleName in styles ) 914 { 915 removeEmpty = removeEmpty || !!element.getStyle( styleName ); 916 916 element.removeStyle( styleName ); 917 } 917 918 918 // Now remove override styles on the element. 919 attributes = overrides[ element.getName() ]; 920 if ( attributes ) 921 removeAttrs(); 922 removeNoAttribsElement( element ); 919 removeEmpty && removeNoAttribsElement( element ); 923 920 } 924 921 925 922 // Removes a style from inside an element.