Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 350584

Summary: [client] [Chrome] [Safari] Middle-click should open menu link in new tab
Product: [ECD] Orion Reporter: Mark Macdonald <mamacdon>
Component: ClientAssignee: Project Inbox <orion.client-inbox>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3    
Version: 0.2   
Target Milestone: 0.3 M1   
Hardware: PC   
OS: Windows 7   
Whiteboard:

Description Mark Macdonald CLA 2011-06-28 10:04:00 EDT
Chrome 13, Safari 5

1. In the Navigator, click the More menu beside a folder that's hooked up to a Git repo.
2. Middle-click (or Ctrl+Click) on the "Git Status" link in the menu.
3. Expected the status page to open in a new tab, but it opens in the same tab.
Comment 1 Mark Macdonald CLA 2011-07-20 10:00:26 EDT
In WebKit the onClick handler of dijit.MenuItem is called on middle-click. The command framework uses a helper function to open the link, which doesn't check for the middle-button when it decides whether to open a new window.

In Firefox, onClick is not called for middle-click. Instead it falls back to the native browser behavior (which happens to be "open in new tab").

I would prefer to fix this by making it work like FF for all menu items that contain a link. The browser should handle the event. We should avoid emulating the native browser behavior, since it's impossible to get right.
Comment 2 Mark Macdonald CLA 2011-08-04 14:35:12 EDT
Fixed by overriding dijit.MenuItem so that the click handler is not called when dealing with a menu item that's just a link (ie. a "hrefCallback" in the command framework). Both left- and middle-mouse events are handled natively by the browser

http://git.eclipse.org/c/orion/org.eclipse.orion.client.git/commit/?id=87ea0be070b7d02ac0aae7534471ef64d96a1341