Home Download Buy Blog Forum Support

Hide parent menu item in context menu

Hide parent menu item in context menu

Postby jtwebb on Mon Sep 02, 2013 12:00 am

I've used is_visible to hide menu items that aren't needed. But the problem I'm running into is that the parent menu item is still visible, just without any children. Is there any way to hide the parent item if it has no children?

I have this in my Context.sublime-menu:

Code: Select all
{
            "caption": "FOS User",
            "children": [
                {
                    "caption": "Create",
                    "command": "sf_fos_user_create",
                    "id": "fosuserSfFosUserCreate"
                },
                {
                    "caption": "Activate",
                    "command": "sf_fos_user_activate",
                    "id": "fosuserSfFosUserActivate"
                },
                {
                    "caption": "Deactivate",
                    "command": "sf_fos_user_deactivate",
                    "id": "fosuserSfFosUserDeactivate"
                },
                {
                    "caption": "Promote",
                    "command": "sf_fos_user_promote",
                    "id": "fosuserSfFosUserPromote"
                },
                {
                    "caption": "Demote",
                    "command": "sf_fos_user_demote",
                    "id": "fosuserSfFosUserDemote"
                },
                {
                    "caption": "Change Password",
                    "command": "sf_fos_user_change_password",
                    "id": "fosuserSfFosUserChangePassword"
                }
            ]
        }


All the children are gone when the FOS User bundle isn't available. But the 'FOS User' is still there. That's what I want to get rid of. Thanks for the help!
jtwebb
 
Posts: 14
Joined: Sat Jul 20, 2013 5:19 am

Return to Plugin Development

Who is online

Users browsing this forum: Yahoo [Bot] and 10 guests