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

Editor format tools delays execution on empty lines ???

5 Answers 34 Views
Editor
This is a migrated thread and some comments may be shown as answers.
Dustin
Top achievements
Rank 1
Dustin asked on 22 Apr 2013, 02:08 PM
Why are some of the formatting options applied to an empty line (<p></p> or <p><span></span></p>) delayed and added to the pending formats until a character is added? If I want to apply a font size to an empty line, but leave that line empty the format is never applied because it is added to the pending formats and if I don't add any text to that line then the format never gets applied. How can I change this functionality?

I've tried overriding the willDelayExecution method to return always return false on the fontSize tool for example when I have a <p><span></span></p>, but the fontSize doesn't get applied even when the Range's startContainer is the text node inside the span element. Your anchor marker element gets added after the text node and I'm not sure if that's what the problem is.

Please help because this is a much needed. My users can't change the font sizes of empty lines for consistent layout through out the document.

5 Answers, 1 is accepted

Sort by
0
Alex Gyoshev
Telerik team
answered on 23 Apr 2013, 07:04 AM
Hello Dustin,

This functionality is hard to change, due to the fact that IE does not allow to focus empty nodes. If you need to have pre-defined styling on a row, you can either insert a whitespace in it (so that it has content), or use a stylesheet that sets the default paragraph styles.

All the best,
Alex Gyoshev
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Dustin
Top achievements
Rank 1
answered on 23 Apr 2013, 01:03 PM
The span node is not empty, it has a empty text node. Now if I override the willDelayExecution method on the fontSize tool, the range is passed in and the startContainer is the text node and from there I can get the parent span to apply the font size to.

I know that Google Docs is a lot more advanced then your guys' editor, but that editor does not delay any format execution. If you are on an empty line and apply a format, the format gets applied immediately.

And by the way, an empty space does not apply the format immediately either. It doesn't get applied until a character exists in the text node. Even highlighting the empty space and applying a different font size still adds it to the pending formats.

Also, this is not a default style requirement. If a user needs to change the font size of an empty row to whatever how am I supposed to know what that font size is going to be and what if one empty line they want a font size 10px and another 16px?

This seems like functionality that should have been there from the beginning instead of designing a complicated pending formats process to post pone formats on empty text nodes. Seems like overkill on something that could have been so much simpler and taken care of immediately instead having to track formats to apply at a later time.
0
Alex Gyoshev
Telerik team
answered on 24 Apr 2013, 07:42 AM
Hello Dustin,

> This seems like functionality that should have been there from the beginning instead of designing a complicated pending formats process to post pone formats on empty text nodes.
We are actually on the same page about this. In fact, we did have this implemented prior to switching to the pending formats algorithm. We switched because of the many errors that were occurring when we used the other approach.

Since we are currently refactoring the editor code, we will consider improving the situation around the pending formats. This will be done no sooner than Q2.2013.

Regards,
Alex Gyoshev
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Accepted
Dustin
Top achievements
Rank 1
answered on 24 Apr 2013, 12:54 PM
That is good to hear that you guys will be refactoring the editor code. I really hope you guys implement this functionality into the new editor.

Also, any idea when the roadmap for Q2.2013 will be available? I am really curious what new cool stuff you guys will be adding to the Kendo suite, specifically the editor.
0
Brandon
Telerik team
answered on 24 Apr 2013, 01:56 PM
Hi Dustin,

The roadmap will be announced later today, via the blogs, so stay tuned there! 

Kind regards,
Brandon
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Tags
Editor
Asked by
Dustin
Top achievements
Rank 1
Answers by
Alex Gyoshev
Telerik team
Dustin
Top achievements
Rank 1
Brandon
Telerik team
Share this question
or