Ticket #3728: 3728.patch

File 3728.patch, 843 bytes (added by martinkou, 3 years ago)
  • _source/plugins/colorbutton/plugin.js

     
    6666 
    6767                                        panel.hide(); 
    6868 
    69                                         var style = new CKEDITOR.style( config['colorButton_' + type + 'Style'], { color : color || '#000' } ); 
     69                                        var removeColor = null; 
     70                                        if ( !color ) 
     71                                        { 
     72                                                var element = editor.getSelection().getStartElement(); 
     73                                                removeColor = element .getComputedStyle( type == 'back' ? 'background-color' : 'color' ); 
     74                                        } 
    7075 
     76                                        var style = new CKEDITOR.style( config[ 'colorButton_' + type + 'Style' ], { color : color || removeColor } ); 
     77 
    7178                                        editor.fire( 'saveSnapshot' ); 
    7279                                        if ( color ) 
    7380                                                style.apply( editor.document ); 
© 2003 – 2011 CKSource – Frederico Knabben. All rights reserved. | Terms of use | Privacy policy