Completed
Last Updated: 17 Jan 2022 11:39 by ADMIN
ADMIN
Ianko
Created on: 24 Mar 2016 14:13
Category: Editor
Type: Bug Report
0
RadEditor in Fullscreen and Lightweight has incorect size
The height is bigger than the viewport.

If there are toolbars docked at the left or right, the right toolbar is hidden due to larger width. 


You can fix a bit the width by using this code:

<telerik:RadEditor ID="RadEditor1" runat="server" RenderMode="Lightweight" OnClientCommandExecuted="OnClientCommandExecuted">
    <Tools>
        <telerik:EditorToolGroup>
            <telerik:EditorTool Name="AjaxSpellCheck" />
        </telerik:EditorToolGroup>
        <telerik:EditorToolGroup dockingzone="Left">
            <telerik:EditorTool Name="AjaxSpellCheck" />
        </telerik:EditorToolGroup>
        <telerik:EditorToolGroup dockingzone="Right">
            <telerik:EditorTool Name="ToggleScreenMode"></telerik:EditorTool>
        </telerik:EditorToolGroup>
    </Tools>
</telerik:RadEditor>

<script>
    function OnClientCommandExecuted(editor, args) {
        if (args.get_commandName() === "ToggleScreenMode" && editor.isFullScreen()) {
            var editorId = editor.get_id();
            var editorElm = editor.get_element();
            var leftToolbar = $telerik.$(editorElm).find("#" + editorId + "Left.reToolBarWrapper");
            var rightToolbar = $telerik.$(editorElm).find("#" + editorId + "Right.reToolBarWrapper");

            var widthExcess = leftToolbar.width() + rightToolbar.width();

            if (widthExcess) {
                editorElm.style.width = (parseInt(editorElm.style.width) - widthExcess) + "px";
            }
        }
    }
</script>
0 comments