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

Custom Dialog HyperLink - Wrap Image

3 Answers 65 Views
Editor
This is a migrated thread and some comments may be shown as answers.
Matt
Top achievements
Rank 2
Matt asked on 17 Jul 2008, 10:39 PM
Howdy,

I have a custom dialog for linink to pages in my site which is great it uses this client script below and inserts text into the editor.

   var myCallbackFunction = function(sender, args)
       {
           editor.pasteHtml(String.format("<a href={0} originalAttribute="href" originalPath="{0}" target='{1}' class='{2}'>{3}</a> ", args.href, args.target, args.className, args.name))
       }

The big question is my user compalin when  they want to link and Image they have to manually go into the markup and cut and paste, im may cases users have no idea.

Is there an example where script that can get the element and wrap it around an image??

This would be very helpful.

cheers

Matt

3 Answers, 1 is accepted

Sort by
0
Rumen
Telerik team
answered on 18 Jul 2008, 12:37 PM
Hi Matt,

Please, review the following article: getParentElement. You can check whether the selected item is of type IMG tag and wrap the link over it.

Best regards,
Rumen
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Matt
Top achievements
Rank 2
answered on 12 Aug 2008, 03:34 AM
anyone have a working example I can adapt?
0
Rumen
Telerik team
answered on 12 Aug 2008, 01:15 PM
Hi Matt,

Please, find attached the requested custom link manager example.

Best regards,
Rumen
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
Editor
Asked by
Matt
Top achievements
Rank 2
Answers by
Rumen
Telerik team
Matt
Top achievements
Rank 2
Share this question
or