hayesmaker / doomsdayconsole

originally code.google.com/p/doomsdayconsole
0 stars 0 forks source link

The ContextMenuUtil.setUp method overwrites any other context menu(s) that may be associated with the Document Class. #5

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. The ContextMenuUtil.setUp method overwrites any other context menu(s) that 
may be associated with the Document Class.

What is the expected output? What do you see instead?
It would be handy to check if context menus exist and append if so.

What version of the product are you using? On what operating system?

Please provide any additional information below.
Something like this:

Instead of:

Line 75 and 76:

if (!root.contextMenu) root.contextMenu = new ContextMenu();
root.contextMenu = baseMenu;

Use instead:

// check if contextMenu has items so we don't overwrite the context memu //
if (!root.contextMenu)
{
root.contextMenu = new ContextMenu();
root.contextMenu = baseMenu;
} else {
root.contextMenu.customItems = 
root.contextMenu.customItems.concat(baseMenu.customItems);
            }

Original issue reported on code.google.com by johnfrab...@gmail.com on 15 Jun 2010 at 7:41

GoogleCodeExporter commented 8 years ago
Ahh, more specifically, context menus are overwritten if they've been added 
BEFORE the first call to ConsoleUtil.instance.  It would probably be decent 
courtesy to check for the existence of a context menu, as listed in the code 
example above, that way, developers can swap in and out at any point other 
applications using context menus without worry.

Original comment by johnfrab...@gmail.com on 16 Jun 2010 at 2:53

GoogleCodeExporter commented 8 years ago
This is a part of the old DConsole feature set that's currently omitted for 
reevaluation.

When it's reintroduced, you bet we'll do it with more courtesy ;-) Thanks for 
reporting!

Original comment by AndreasVonSpace@gmail.com on 17 Aug 2011 at 8:53