Image Properties - preserve aspect ratio

9 posts, 0 answers
  1. Jeff
    Jeff avatar
    100 posts
    Member since:
    Apr 2008

    Posted 02 May 2008 Link to this post

    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?

  2. Todd Anglin
    Todd Anglin avatar
    2040 posts
    Member since:
    Aug 2005

    Posted 02 May 2008 Link to this post

    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
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Jeff
    Jeff avatar
    100 posts
    Member since:
    Apr 2008

    Posted 02 May 2008 Link to this post

    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> 
     

  5. Rumen
    Admin
    Rumen avatar
    12849 posts

    Posted 08 May 2008 Link to this post

    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
  6. Mario
    Mario avatar
    3 posts
    Member since:
    Apr 2008

    Posted 07 Apr 2009 Link to this post

    Is it possible to set a default value then?

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

    Regards,
    Mario.
  7. Tervel
    Admin
    Tervel avatar
    1337 posts

    Posted 09 Apr 2009 Link to this post

    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.
  8. Jon
    Jon avatar
    26 posts
    Member since:
    Apr 2009

    Posted 03 Jun 2009 Link to this post

    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

     

     

  9. Rumen
    Admin
    Rumen avatar
    12849 posts

    Posted 05 Jun 2009 Link to this post

    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.
  10. Jon
    Jon avatar
    26 posts
    Member since:
    Apr 2009

    Posted 05 Jun 2009 Link to this post

    Rumen,

    Works! Thanks!
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017