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

RealFontSizes not defined in list are selected when set_html() is called

1 Answer 30 Views
Editor
This is a migrated thread and some comments may be shown as answers.
Dave Perrill
Top achievements
Rank 1
Dave Perrill asked on 14 Feb 2014, 12:41 PM
I have a whole slew of font sizes defined in my real font sizes list in the mark up.  When ever I use set_html() and the style of the text has a font size of 16px, 18px, 24px, 32px, or 48px the real font size drop down changes to 3, 4, 5, 6, or 7.  Then when I save my stuff to the database im saving font sizes as 3,4,5,6 or 7 instead of 16, 18, 24, 32 or 48 causing our product to produce extremely small font on the display. 

You can reproduce the issue here: http://demos.telerik.com/aspnet-ajax/editor/examples/editorastextbox/defaultcs.aspx

Simply select 16, 18, 24, 32, or 48 as a size from the drop down, type some text,  cut that text, then paste it back in and you will notice the real font size drop down changes to 3, 4, 5, 6, or 7 depending on what size you choose. 

Here is what the sizes are equating to.
16px = 3
18px = 4
24px = 5
32px = 6
48px = 7

Here is the function I'm using to set my html in the editor.
function SetEditorText(sender) {
    var editor = $find(elementIds.Editor);
    var placeholder = sender.children;
    for (var i = 0; i < placeholder.length; i++) {
        if (placeholder[i].id == sender.id + "Placeholder") {
            if (placeholder[i].innerHTML.toString() !== '') {
                editor.set_html(placeholder[i].innerHTML);
                editor.setFocus();
            }
            else {
                editor.set_html("");
                editor.setFocus();
            }
        }
    }
}


Is there anyway to get a reference to the real font size drop down when set_html() is called and check the selected value of the drop down and if it is 3, 4, 5, 6, or 7 to change it to its appropriate size?

Any help would be greatly appreciated.

Thanks.

1 Answer, 1 is accepted

Sort by
0
Slav
Telerik team
answered on 19 Feb 2014, 09:12 AM
Hello Vikram,

This is a known issue that will be fixed in the upcoming Q1 2014 release of UI for ASP.NET AJAX, scheduled for the end of February. When the new version is available, please upgrade and try the problematic scenario.

Regards,
Slav
Telerik
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the UI for ASP.NET AJAX, subscribe to the blog feed now.
Tags
Editor
Asked by
Dave Perrill
Top achievements
Rank 1
Answers by
Slav
Telerik team
Share this question
or