Unplanned
Last Updated: 24 Mar 2020 17:28 by ADMIN
Alan
Created on: 24 Mar 2020 13:22
Category: Editor
Type: Feature Request
0
Add ability to lock image aspect ratio when resizing an image in RadEditor using the resize handles

Images in a RadEditor can be resized two ways:

1. Using the image properties dialog and keying in width/height. The aspect ratio can be locked here so that keying in width updates height accordingly, and vice versa.

2. Clicking and dragging the resize handles. This does not maintain the aspect ratio of the image, even when the aspect ratio lock option is enabled in the image properties dialog.

Request: That the image aspect ratio lock option in the image properties dialog applies when dragging the resize handles.

1 comment
ADMIN
Rumen
Posted on: 24 Mar 2020 17:28

Hi Alan,

Thank you for your feature request!

Indeed, currently, the images can be resized with enabled aspect ratio only through the provided Image Options dialog and this is the official way provided by the control.

If this feature request gets popular we will plan this useful feature for implementation.  

Since the requested feature is already offered by the Rich Text Editing engine of Firefox, you can enable it there via the following code:

<script>
    var $T = Telerik.Web.UI;
    var $Editor = $T.Editor;
    var initializeResizeWidget = $T.RadEditor.prototype._initializeResizableWidget;
    $T.RadEditor.prototype._initializeResizableWidget = function () {
        if (!Telerik.Web.Browser.ff == true) {
            initializeResizeWidget.call(this);
        }
    }

    function OnClientLoad(editor) {
        if (Telerik.Web.Browser.ff == true) {
                    

            editor.get_document().execCommand('enableObjectResizing', false, true);
            editor.get_document().execCommand('enableInlineTableEditing', false, true);
            editor.get_document().execCommand('enableAbsolutePositionEditor', false, true);
        }

    }
</script>
<telerik:RadEditor ID="radeditor1" runat="server" OnClientLoad="OnClientLoad">
    <Content>
        <img src="images/barcelona.jpg" />
    </Content>
</telerik:RadEditor>

We do appreciate your valuable request and I also updated your Telerik points.

 

Regards,
Rumen
Progress Telerik

Progress is here for your business, like always. Read more about the measures we are taking to ensure business continuity and help fight the COVID-19 pandemic.
Our thoughts here at Progress are with those affected by the outbreak.