Closed Bug 729843 Opened 12 years ago Closed 12 years ago

Provide a way for context menu submenu items to determine their own visibility, separate from the top-level menu

Categories

(Add-on SDK Graveyard :: General, enhancement, P3)

x86_64
Windows 7
enhancement

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: KWierso, Assigned: mossop)

References

Details

(Whiteboard: [jpcontextmenu])

Attachments

(2 files)

Currently, you can only specify contexts on the top-most menu item (whether that's an actual menu item or a menu that contains other items). There's no easy way to only show some of the items within another menu, or to hide others.

This makes things hard or painful to do in a number of cases. In order to get the same behavior (group certain menu items together in a sub-menu, but only have some subset of them shown at any time), you have to duplicate the entire sub-menu's contents so each one contains each possible combination of items to be shown based on the parent menu's context rules. You could also try doing something like manually adding and removing items from the menu, but that's not any better.

It would be really nice to be able to separately specify both the parent menu's context and the items contained within that menu.

As an example, create a top-level menu that will be displayed when the user context-clicks an image on the page. Within that top-level menu, have a number of menu items available that only appear when the image matches certain attributes (like filetype or rotation or something similar).
This is a "Rotate Image" context submenu with items "Left" and "Right".
Wanting the submenu to dynamically show the appropriate submenus between "Left" and "Right" and "Reset" depending on the MozTransform rotate value resulted in tripling the size with much duplication of code.
Feel free to attach better versions of this example that aren't as bloating.
This was just my first ever extension.
Severity: normal → enhancement
Priority: -- → P3
Whiteboard: [jpcontextmenu]
Depends on: 788324
I have this working in bug 788324
Assignee: nobody → dtownsend+bugmail
Status: NEW → ASSIGNED
Fixed by bug 788324
Status: ASSIGNED → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Target Milestone: --- → 1.13
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: