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

Click region for code snippet

2 Answers 83 Views
Editor
This is a migrated thread and some comments may be shown as answers.
Delphi
Top achievements
Rank 1
Delphi asked on 23 Jun 2010, 04:57 PM
Howdy!

So my customer just came across a rather interesting issue. Using the code snippet button, if they click on the edge of the icon, see attached screenshot028, the editor pastes in the last used code snippet. It will also paste it in if we click the code snippet icon on the left of the button. If we click the little black triangle, attached screenshot029, it gives us the menu. I was able to recreate this on the Telerik's website.

Any chance we can set the entire button to show the menu regardless?

Thanks,

2 Answers, 1 is accepted

Sort by
0
Accepted
Dobromir
Telerik team
answered on 25 Jun 2010, 02:22 PM
Hi David,

This is not an issue but the default behavior of the SplitButton tools of RadEditor. By design, the tool store the last selected value for a quicker access.

It is possible to intercept the execution of the command and reset the SplitButton stored selection using the following sample code:
<script type="text/javascript">
    function OnClientPasteHtml(editor, args)
    {
        if (args.get_commandName() == "InsertSnippet")
        {
            var snippetTool = editor.get_toolAdapter().getToolByName("InsertSnippet")
            if (snippetTool)
            {
                snippetTool.set_selectedIndex(-1);
            }
        }
    }
</script>

I hope this helps.

Best wishes,
Dobromir
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
Delphi
Top achievements
Rank 1
answered on 25 Jun 2010, 03:29 PM
perfect!
Tags
Editor
Asked by
Delphi
Top achievements
Rank 1
Answers by
Dobromir
Telerik team
Delphi
Top achievements
Rank 1
Share this question
or