Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Peter Schermers 112 posts 134 karma points
    Jul 30, 2012 @ 09:42
    Peter Schermers
    0

    Hide arrows

    When applying the use of the Rich Text Editor on a small screen, it's obviously very useful having those little 'side arrows' around, so you can 'scroll' through all the options the RTE provides. But when I create a custom RTE with only a few three options applied to it, those arrows still remain.

    How can I hide these user unfriendly arrows, which are suggesting there are more (hidden) options than the ones visible?

  • Jeroen Breuer 4908 posts 12265 karma points MVP 5x admin c-trib
    Jul 30, 2012 @ 11:40
    Jeroen Breuer
    0

    Hello,

    There is an event called AfterContentControlLoad (in Umbraco.controls.ContentControl) and I've once been able to hide the complete menu. Here is the code I used:

    public void ContentControl_AfterContentControlLoad(ContentControl contentControl, ContentControlLoadEventArgs e)
    {
        //Get the id of the document.
        int id = Convert.ToInt32(HttpContext.Current.Request.QueryString["id"]);
    
        //Get the document.
        Document document = new Document(id);
    
        //Get the userId of the current user.
        int userId = UmbracoEnsuredPage.GetUserId(UmbracoEnsuredPage.umbracoUserContextID);
    
        //Check if the current user is the creator of the document. If he's not the menu will be disabled and the user can't save the data.
        //If the userId is 0 the user is the admin and this code must be skipped because the admin must be able to edit everything.
        if ((document.Creator.Id != userId) && (userId != 0))
        {
            foreach (Control control in contentControl.Controls)
            {
                //Search all the TabPage controls in the contentControl.
                if (control is TabPage)
                {
                    //Hide the menu.
                    ((TabPage)control).Menu.Attributes["style"] = "Display: none;";
                }
            }
        }
    }

    Maybe you can use something like to this to hide those arrows.

    Jeroen

  • Peter Schermers 112 posts 134 karma points
    Jul 30, 2012 @ 11:42
    Peter Schermers
    0

    O wow, that's looking interesting! Though a bit too hard too build for me, I'm afraid ;-)
    Thanks anyway, I guess I assumed there would just be a simple check box to hide those arrows ;-) 

Please Sign in or register to post replies

Write your reply to:

Draft