Ticket #5336: 5336.patch
File 5336.patch, 2.2 KB (added by , 14 years ago) |
---|
-
_source/plugins/styles/plugin.js
137 137 return ( this.removeFromRange = 138 138 this.type == CKEDITOR.STYLE_INLINE ? 139 139 removeInlineStyle 140 : this.type == CKEDITOR.STYLE_OBJECT ? 141 removeObjectStyle 140 142 : null ).call( this, range ); 141 143 }, 142 144 … … 719 721 element && setupElement( element, this ); 720 722 } 721 723 724 function removeObjectStyle( range ) 725 { 726 var root = range.getCommonAncestor( true, true ), 727 element = root.getAscendant( this.element, true ); 728 729 if ( !element ) 730 return; 731 732 var style = this; 733 var def = style._.definition; 734 var attributes = def.attributes; 735 var styles = CKEDITOR.style.getStyleText( def ); 736 737 // Remove all defined attributes. 738 if ( attributes ) 739 { 740 for ( var att in attributes ) 741 { 742 element.removeAttribute( att, attributes[ att ] ); 743 } 744 } 745 746 // Assign all defined styles. 747 if ( def.styles ) 748 { 749 for ( var i in def.styles ) 750 { 751 if ( !def.styles.hasOwnProperty( i ) ) 752 continue; 753 754 element.removeStyle( i ); 755 } 756 } 757 } 758 722 759 function applyBlockStyle( range ) 723 760 { 724 761 // Serializible bookmarks is needed here since … … 1080 1117 } 1081 1118 1082 1119 // Assign all defined styles. 1083 if ( styles ) 1084 el.setAttribute( 'style', styles ); 1120 if ( def.styles ) 1121 { 1122 for ( var i in def.styles ) 1123 { 1124 if ( !def.styles.hasOwnProperty( i ) ) 1125 continue; 1085 1126 1127 el.setStyle( i, def.styles[ i ] ); 1128 } 1129 } 1130 1086 1131 return el; 1087 1132 } 1088 1133 -
_source/plugins/stylescombo/plugin.js
108 108 109 109 if ( style.type == CKEDITOR.STYLE_INLINE && style.checkActive( elementPath ) ) 110 110 style.remove( editor.document ); 111 else if ( style.type == CKEDITOR.STYLE_OBJECT && style.checkActive( elementPath ) ) 112 style.remove( editor.document ); 111 113 else 112 114 style.apply( editor.document ); 113 115