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

RadEditor issue with FontSize for "RealFontSize" under IE

3 Answers 195 Views
Editor
This is a migrated thread and some comments may be shown as answers.
Bradley Davidson
Top achievements
Rank 1
Bradley Davidson asked on 13 Jul 2010, 11:28 AM
Hi,
  I found one issue and really appreciate if you help me to find what is wrong.

  There is RadEditor on the page: <telerik:RadEditor ... />
  Initialization is following:
                radEditor.Tools.Clear();
             EditorToolGroup toolBar = new EditorToolGroup();          
...
                toolBar.Tools.Add(new EditorSeparator());
            EditorTool fontsize = new EditorTool("RealFontSize");
            toolBar.Tools.Add(fontsize);
            toolBar.Tools.Add(new EditorTool("Bold"));
            toolBar.Tools.Add(new EditorTool("Italic"));
            toolBar.Tools.Add(new EditorTool("Underline"));
            toolBar.Tools.Add(new EditorSeparator());
            toolBar.Tools.Add(new EditorTool("ForeColor"));
            toolBar.Tools.Add(new EditorTool("BackColor"));
...
                 radEditor.Tools.Add(toolBar);

  Issue is following: under IE8 (in both modes 8 & 7) when enter some text, select the text, choose some font size, click on Bold button - in font size DDL there is 100%, but must be the font size.
  Note that the same for Italic and Underline buttons. The issue is only under IE browser, e.g. FF works properly.

  I attached two screens: first just how it works w/o click on Bold button, other one when click on the button.

  Could you please take a look and update me how I can fix it and what's the main reason of the issue?

Thanks.

3 Answers, 1 is accepted

Sort by
0
Rumen
Telerik team
answered on 13 Jul 2010, 11:58 AM
Hi Brad,

The information displayed in the RealFontSize dropdown header is returned by the browser's queryCommandValue method. Firefox, Safari and Chrome returns the font-size information in pixels. Internet Explorer returns the font-size in points.

I haven't seen font sizes set in percents but you can try to update the dropdown header value with the desired size value using the solution provided in this forum thread:
Firefox, Chrome won't display fonts in point size.

Best regards,
Rumen
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Volodymyr Tatarin
Top achievements
Rank 1
answered on 14 Jul 2010, 10:58 AM
Hi Rumen,

  The list of items is correct, but selected value is wrong ("100%"). I attached a screenshot.

  I try to use following code:
function OnClientCommandExecuted(editor, commandName, tool) {
    var tool = editor.getToolByName("RealFontSize");
    if (tool && $telerik.isIE && tool.get_value() == "100%") {
        tool.set_value(tool.get_selectedItem());
    }
}
It works as hack, but unfortunately for small font sizes (<= '11px') issue is still reproducible. For bigger numbers (> '12px') all is fine with the hack.
Main strange is that tool.get_value() returns "100%", but tool.get_selectedItem() returns correct value, e.g. '16px'

Attempt to push the same code under
function OnClientSelectionChange(editor, args)
didn't get any effect.

The issue is only when you selected the text, push at least on button ('Bold', 'Italic' or 'Underline'). With the hack you should also select less font size value, e.g. '10px'

I have a video clip how it looks (226Kb), but I can't attached it to the message. I can send it to you, just update me.

Thanks, Volodymyr.
0
Rumen
Telerik team
answered on 16 Jul 2010, 11:16 AM
Hi Volodymyr,

Could you please open a support ticket and send a sample working project along with sample content and steps to reproduce this browser behavior? Please, also attached your video so that we can see the problem.


Best regards,
Rumen
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
Editor
Asked by
Bradley Davidson
Top achievements
Rank 1
Answers by
Rumen
Telerik team
Volodymyr Tatarin
Top achievements
Rank 1
Share this question
or