Hi,
I put an "Insert Groupbox" item in the toolbar and I wrote a function for it like this:
| <script type="text/javascript"> |
| Telerik.Web.UI.Editor.CommandList["InsertGroupbox"] = function(commandName, editor, args) { |
| var selElem = editor.getSelection().getParentElement(); |
| if (selElem.tagName != "FIELDSET") { |
| editor.pasteHtml('<fieldset style="left: 20px; top: 20px; width: 200px; position: absolute; height: 80px;">Place your text here... </fieldset>'); |
| } |
| }; |
| </script> |
It's working nice while the cursor is in the body text of the editor.
But when an existing Element is selected (groupbox, image, etc.), the element is removed and the groupbox is inserted.
How to create an exception to avoid this replacement only when inserting groupboxes ?
Thanks,
Sébastien
