Preview Mode + Floating Toolbar issue

3 posts, 1 answers
  1. Christian
    Christian avatar
    5 posts
    Member since:
    Sep 2012

    Posted 21 Nov 2012 Link to this post

    Hello all,

    I am using a RadEditor in where I need to enable Edit Mode or Preview Mode based on permissions (Only specific users can edit the content).

    So, it is working OK but because of space, I need to use the "Floating" toolbar option.

    The issue appears when I set Preview Mode + Floating Toolbar...and it is that the toolbar allows me to edit the content...If I use "Default" Toolbar mode...it appears as "grey out" and I cannot use it...achieving what I need...but if I go back to "Floating" mode, the restriction goes off.

    Please let me know if you have any ideas about what could be happening.

    This is what I am calling in the "OnLoad" method...

    private void SetEditorMode()
           {       
               this.HelpContentRadEditor.ToolbarMode = EditorToolbarMode.Floating;
               this.HelpContentRadEditor.EditModes = EditModes.Preview;
           }


    I also tried with JavaScript with no luck...

    function OnClientLoad(editor, args) {
        setTimeout(function () {
            editor.set_mode(4);
        }, 150);
    }


    Thanks all for your help!!!

    Christian
  2. Answer
    Rumen
    Admin
    Rumen avatar
    14100 posts

    Posted 26 Nov 2012 Link to this post

    Hi,

    If the user does not have sufficient permissions you can hide the floating button or directly its toolbar using the following script:

    <telerik:RadEditor ID="RadEditor1" runat="server" OnClientLoad="OnClientLoad"></telerik:RadEditor>
    <script type="text/javascript">
        function OnClientLoad(editor) {
            setTimeout(function () {
                var button = $telerik.$(".ToggleFloatingToolbar")[0];
                button.parentNode.parentNode.parentNode.style.display = "none";
            }, 1000);
        }
    </script>


    Kind regards,
    Rumen
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
  3. Christian
    Christian avatar
    5 posts
    Member since:
    Sep 2012

    Posted 23 Jan 2013 Link to this post

    It worked perfectly. I just removed the timing thing when implemented.

    Thanks for your help!
Back to Top