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

Image Properties - preserve aspect ratio

8 Answers 206 Views
Editor
This is a migrated thread and some comments may be shown as answers.
Jeff
Top achievements
Rank 1
Jeff asked on 02 May 2008, 04:46 PM
In the Editor, the image propreties dialog has a preserve aspect ratio gadget - looks like a couple of plugs that plug together when you click on it.

It's unplugged by default - so aspect ratio is not preserved.

Is there a way to change this so that it is plugged in, by default?  So that aspect ratio is preserved, when editing images, unless the user specifically asks that it not be?

8 Answers, 1 is accepted

Sort by
0
Todd Anglin
Top achievements
Rank 2
answered on 02 May 2008, 07:29 PM
Jeff-

I think the default behavior is to constrain the proportions. At least, that's the way the online demos behave. Check out this online demo with the image properties dialog and let me know how it differs from your setup:

http://www.telerik.com/DEMOS/ASPNET/Prometheus/Editor/
Examples/EditModes/DefaultCS.aspx

-Todd
0
Jeff
Top achievements
Rank 1
answered on 02 May 2008, 07:38 PM
I am seeing the behavior you describe in that demo.  The aspx behind that demo is very simple, that behind ours isn't all that complicated.  I'm not seeing any setting in either the demo's code or in ours, that I would expect to control this behavior.

<telerik:RadEditor ID="reContent" runat="server"  
    AutoResizeHeight="false" Height="600px" Width="800px"  
    ContentAreaCssFile="~/CSS/Omega.css" EditModes="All" Skin="Default"  
    StripFormattingOnPaste="None" StripFormattingOptions="None"  
    ToolbarMode="Default" 
> 
    <CssFiles> 
        <telerik:EditorCssFile Value="~/css/Omega.css" /> 
    </CssFiles> 
    <ImageManager ViewPaths="~/AssocImages" UploadPaths="~/AssocImages"  
        DeletePaths="~/AssocImages" MaxUploadFileSize="50000000" /> 
    <DocumentManager ViewPaths="~/AssocDocuments" UploadPaths="~/AssocDocuments"  
        DeletePaths="~/AssocDocuments" MaxUploadFileSize="50000000" /> 
    <SpellCheckSettings SpellCheckProvider="PhoneticProvider"  
        WordIgnoreOptions="RepeatedWords" /> 
    <Content> 
    </Content> 
</telerik:RadEditor> 
 

0
Rumen
Telerik team
answered on 08 May 2008, 08:43 AM
Hi Jeff,

I am aware of this glitch and it is fixed in the in-house build of RadEditor. The fix will be available in the next service pack release of RadControls for ASP.NET AJAX.

Best regards,
Rumen
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Mario
Top achievements
Rank 1
answered on 07 Apr 2009, 09:52 AM
Is it possible to set a default value then?

So "keep aspect ration" is always "checked" per default?

Regards,
Mario.
0
Tervel
Telerik team
answered on 09 Apr 2009, 10:24 AM
Hello Mario,

The easiest way to do it is to modify the dialog markup itself. All editor dialogs are shipped with the RadControls installation and the editor can be configured to use one or more of them from an external location by using the ExternalDialogsPath property.

The following online demo provides you with information on how to modify a dialog:
http://demos.telerik.com/aspnet-ajax/editor/examples/externaldialogspath/defaultcs.aspx

Sincerely yours,
Tervel
the Telerik team

Check out Telerik Trainer , the state of the art learning tool for Telerik products.
0
Jon
Top achievements
Rank 1
answered on 03 Jun 2009, 10:54 AM
Hello,

I am also trying to make this work as default "plugged in".

I have found that setting:

 

this._constrainDimentions = true;

in

 

Telerik.Web.UI.Widgets.ImageProperties =

function(element)

in SetImageProperties.ascx

changes the behavior, but does not update the "plugged in" gadget.

I tried:

 

this._constrainDimentions = true

 

this._updateConstraintGauges();

 

 

 Sys.UI.DomElement.addCssClass(

 

this._constrainButton.parentNode, "toggle");

 

 

but that does not work right.

Any suggestions?

Thanks

 

 

0
Rumen
Telerik team
answered on 05 Jun 2009, 01:42 PM
Hi Jon,

Please, open the \EditorDialogs\SetImageProperties.ascx file, locate the _initializeChildEvents function and put in the end the following line

this._constrainButton.click();

e.g.

    _initializeChildEvents: function() 
    { 
        $addHandlers(this._imageWidth, { "keyup"this._validateDimensionByWidth }, this); 
        $addHandlers(this._imageWidth, { "keydown"this._validateNumber }, this); 
        $addHandlers(this._imageHeight, { "keyup"this._validateDimensionByHeight }, this); 
        $addHandlers(this._imageHeight, { "keydown"this._validateNumber }, this); 
        $addHandlers(this._constrainButton, { "click"this._constrainClickHandler }, this); 
        if (this._insertButton) $addHandlers(this._insertButton, {"click" : this._insertClickHandler}, this); 
        if (this._cancelButton) $addHandlers(this._cancelButton, {"click" : this._cancelClickHandler}, this); 
        this._constrainButton.click(); //Click the constrain button
    }, 

Save the file.
This solution works fine on my side.

All the best,
Rumen
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Jon
Top achievements
Rank 1
answered on 05 Jun 2009, 02:36 PM
Rumen,

Works! Thanks!
Tags
Editor
Asked by
Jeff
Top achievements
Rank 1
Answers by
Todd Anglin
Top achievements
Rank 2
Jeff
Top achievements
Rank 1
Rumen
Telerik team
Mario
Top achievements
Rank 1
Tervel
Telerik team
Jon
Top achievements
Rank 1
Share this question
or