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.
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.