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

Proportional Image Resizing + IE

1 Answer 66 Views
Editor
This is a migrated thread and some comments may be shown as answers.
Igor Kalders
Top achievements
Rank 1
Igor Kalders asked on 18 Aug 2008, 01:56 PM
With tips from your online resources, I managed to get proportional resizing done in RadEditor Classic, by hooking some JavaScript onto "oncontrolselect".

editor.AttachEventHandler("oncontrolselect"function() 
  // Introduce small delay 
  window.setTimeout(function() 
  { 
    // 1. Check if we have an image, 
    // 2. Get it's original dimensions and 
    // 3. install "onresizeend"-handler to constrains proportions 
  }, 100); 
}); 

I'm now trying to apply the same style of code to RadEditor ASP.NET AJAX, but with no success yet. I've replaced the AttachEvenHandler line with

$telerik.addExternalHandler(editor.get_document().body, "oncontrolselect"function() 
  // ... 
}); 

Before I start digging this out: is the oncontrolselect event still available? Am I hooking correctly? Is there something else I might be overseeing?

1 Answer, 1 is accepted

Sort by
0
Rumen
Telerik team
answered on 18 Aug 2008, 02:40 PM
Hi Igor,

Here is how to attach the oncontrolselect event to RadEditor for ASP.NET AJAX:

<script type="text/javascript">
function OnClientLoad(editor, args)
{                 
   editor.attachEventHandler("oncontrolselect", function(e)
   {
       alert(1);
   });
}
</script>
<telerik:radeditor runat="server" ID="RadEditor1"
    OnClientLoad="OnClientLoad">
    <Content><img src=""></img></Content>
</telerik:radeditor>


Best regards,
Rumen
the Telerik team

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