Completed
Last Updated: 24 Feb 2015 10:21 by ADMIN
ADMIN
Ianko
Created on: 19 Feb 2015 11:59
Category: Editor
Type: Bug Report
0
Setting custom Localization text to either of Design, HTML, Preview buttons, break the button behavior in Lightweight mode
Using code behind or localization file to change the text of the Design, Preview or HTML buttons break the functionality that enables the end-user to change the modes.

The following snippet can be used as a temporary workaround.

<style type="text/css">
    /* Fixes the visual glitch */
    .reModes a {
        width:auto !important;
    }
</style>

<telerik:RadEditor runat="server" ID="RadEditor1" RenderMode="Lightweight" OnClientLoad="OnClientLoad">
</telerik:RadEditor>

<script type="text/javascript">
    function OnClientLoad(editor, args) {
        var $ = $telerik.$;
         
        if (editor.get_renderMode() != Telerik.Web.UI.RenderMode.Lite) return;

        var designAttr = editor.get_localization()["RadEditorDesignMode".toLowerCase()];
        var htmlAttr = editor.get_localization()["RadEditorHtmlMode".toLowerCase()];
        var previewAttr = editor.get_localization()["RadEditorPreviewMode".toLowerCase()];
        
        $("a[title=\"" + designAttr + "\"]").attr("title", "Design");
        $("a[title=\"" + htmlAttr + "\"]").attr("title", "HTML");
        $("a[title=\"" + previewAttr + "\"]").attr("title", "Preview");
    }
</script>
0 comments