This is a migrated thread and some comments may be shown as answers.

Removing forecolour of backcolour from selection

1 Answer 22 Views
Editor
This is a migrated thread and some comments may be shown as answers.
Datamex
Top achievements
Rank 2
Datamex asked on 19 Aug 2009, 12:24 PM
Hi,

I have multiple RadEditors in the CMS of a webshop, with which it is possible to change different texts on the webshop. I added the tools for changing the fore- and backcolour of the text. This works as expected, except when you want to remove the colouring (and go back to the default colour, as specified in the css file). The colour controls have an "empty" colour in their top left, which shows as black on white in the two bars below the colourpicker. But somehow the text itself does not change colour. This problem also exists in the demo.

Any help is appreciated.

1 Answer, 1 is accepted

Sort by
0
Rumen
Telerik team
answered on 24 Aug 2009, 08:09 AM
Hi Datamex,

I was able to reproduce this problem in Firefox only.

Please, try the following code that will solve the issue in Firefox:

<script type="text/javascript">   
function OnClientCommandExecuted(editor, args)   
{   
   if (!args || !args.get_commandName) return;                             
   var command = args.get_commandName();  
   var value = args.get_value();  
     
   if (command == "ForeColor" || command == "BackColor")  
   {  
       if ($telerik.isIE) return
       if (value.trim() == "")  
       {  
         editor.get_document().execCommand("RemoveFormat"nullnull);  
         editor.fire("FormatStripper", {value : "SPAN"});   
   
       }  
   }  
}  
</script>   
   
<telerik:radeditor   
   runat="server"   
   ID="RadEditor1"   
   OnClientCommandExecuted="OnClientCommandExecuted" >   
   <Content> sample content </Content>   
</telerik:radeditor>   


Best wishes,
Rumen
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Tags
Editor
Asked by
Datamex
Top achievements
Rank 2
Answers by
Rumen
Telerik team
Share this question
or