Bug 350584 - [client] [Chrome] [Safari] Middle-click should open menu link in new tab
Summary: [client] [Chrome] [Safari] Middle-click should open menu link in new tab
Status: RESOLVED FIXED
Alias: None
Product: Orion (Archived)
Classification: ECD
Component: Client (show other bugs)
Version: 0.2   Edit
Hardware: PC Windows 7
: P3 normal (vote)
Target Milestone: 0.3 M1   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-06-28 10:04 EDT by Mark Macdonald CLA
Modified: 2011-08-04 14:35 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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