Ticket #3576: 3576_2.patch
File 3576_2.patch, 1.8 KB (added by , 14 years ago) |
---|
-
_source/plugins/styles/plugin.js
867 867 function removeFromElement( style, element ) 868 868 { 869 869 var def = style._.definition, 870 attributes = def.attributes,870 attributes = CKEDITOR.tools.extend( {}, def.attributes, getOverrides( style )[ element.getName() ] ), 871 871 styles = def.styles, 872 overrides = getOverrides( style ); 872 // If the style is only about the element itself, we have to remove the element. 873 removeEmpty = CKEDITOR.tools.isEmpty( attributes ) && CKEDITOR.tools.isEmpty( styles ); 873 874 874 function removeAttrs() 875 { 876 for ( var attName in attributes ) 877 { 878 // The 'class' element value must match (#1318). 879 if ( attName == 'class' && element.getAttribute( attName ) != attributes[ attName ] ) 880 continue; 881 element.removeAttribute( attName ); 882 } 883 } 875 // Remove definition attributes/style from the elemnt. 876 for ( var attName in attributes ) 877 { 878 // The 'class' element value must match (#1318). 879 if ( attName == 'class' && element.getAttribute( attName ) != attributes[ attName ] ) 880 continue; 881 element.removeAttribute( attName ); 882 removeEmpty = true; 883 } 884 884 885 // Remove definition attributes/style from the elemnt.886 removeAttrs();887 885 for ( var styleName in styles ) 886 { 888 887 element.removeStyle( styleName ); 888 removeEmpty = true; 889 } 889 890 890 // Now remove override styles on the element. 891 attributes = overrides[ element.getName() ]; 892 if ( attributes ) 893 removeAttrs(); 894 removeNoAttribsElement( element ); 891 removeEmpty && removeNoAttribsElement( element ); 895 892 } 896 893 897 894 // Removes a style from inside an element.