Ticket #3599: 3599_3.patch
File 3599_3.patch, 2.0 KB (added by , 14 years ago) |
---|
-
_source/plugins/colorbutton/plugin.js
86 86 87 87 panel.hide(); 88 88 89 var style = new CKEDITOR.style( config['colorButton_' + type + 'Style'], { color : color || 'inherit' } );90 89 91 90 editor.fire( 'saveSnapshot' ); 91 92 // Clean up any conflicting style within the range. 93 new CKEDITOR.style( config['colorButton_' + type + 'Style'], { color : 'inherit' } ).remove( editor.document ); 94 92 95 if ( color ) 93 style.apply( editor.document ); 94 else 95 style.remove( editor.document ); 96 { 97 var colorStyle = config['colorButton_' + type + 'Style']; 98 99 colorStyle.childRule = type == 'back' ? 100 // It's better to apply background color as the innermost style. (#3599) 101 function(){ return false; } : 102 // Fore color style must be applied inside links instead of around it. 103 function(){ return element.getName() != 'a'; }; 104 105 new CKEDITOR.style( colorStyle, { color : color } ).apply( editor.document ); 106 } 107 96 108 editor.fire( 'saveSnapshot' ); 97 109 }); 98 110 … … 214 226 { 215 227 element : 'span', 216 228 styles : { 'color' : '#(color)' }, 217 overrides : [ { element : 'font', attributes : { 'color' : null } } ], 218 219 // Fore color style must be applied inside links instead of around it. 220 childRule : function( element ) 221 { 222 return element.getName() != 'a'; 223 } 229 overrides : [ { element : 'font', attributes : { 'color' : null } } ] 224 230 }; 225 231 226 232 /** … … 237 243 CKEDITOR.config.colorButton_backStyle = 238 244 { 239 245 element : 'span', 240 styles : { 'background-color' : '#(color)' }, 241 242 // It's better to apply background color as the innermost style. (#3599) 243 childRule : function( element ) 244 { 245 return false; 246 } 246 styles : { 'background-color' : '#(color)' } 247 247 };