Making WordPress.org

Opened 10 years ago

Closed 9 years ago

#844 closed enhancement (fixed)

Don't prevent opening themes in new tabs

Reported by: jancbeck's profile jancbeck Owned by: obenland's profile obenland
Milestone: Priority: normal
Component: Theme Directory Keywords:
Cc:

Description

The single theme overlay screen looks gorgeous, however, at times I like to inspect a couple of themes within multiple browser tabs to better compare them side-by-side. What I do is I CMD + Click (Mac) on each of the themes in the result list and I expect each of these to open in a new browser tab just like with any other hyperlink. What happens instead is that the single theme overlay opens in the same tab I'm currently in.

In theme.js around line 61 there should be a check if the user has currently pressed the CMD or CTRL key and if that's the case

event.preventDefault();

should not run. Ideally it should also check for a mousedown event of the middle mouse button since that triggers a new tab in most browsers I'm aware of.

Change History (9)

#1 follow-up: @jancbeck
10 years ago

Related to that, right-clicking a theme item and choosing "open in new window" does not work because the links point to https://wordpress.org/{$themename}/. This could be because of the "preview" state of the new theme directory so I did not include it into the initial ticket. However it would be great to see this working in the final state.

#2 @obenland
10 years ago

  • Owner set to obenland
  • Resolution set to fixed
  • Status changed from new to closed

In 1265:

WP.org Themes: Don't prevent opening themes in new tabs.

Wrapps the anchor around all child elements of .theme to allow users to
either right-click and choose to open the link in a new tab, or click the link
with a meta modifier key pressed (command/Ctrl).

Fixes #844.

#3 in reply to: ↑ 1 @obenland
10 years ago

Replying to jancbeck:

Related to that, right-clicking a theme item and choosing "open in new window" does not work because the links point to https://wordpress.org/{$themename}/. This could be because of the "preview" state of the new theme directory so I did not include it into the initial ticket. However it would be great to see this working in the final state.

Faulty URLs were fixed in r1256.
Thanks for the report, @jancbeck!

This ticket was mentioned in Slack in #meta by mrwweb. View the logs.


9 years ago

#5 follow-up: @mrwweb
9 years ago

  • Resolution fixed deleted
  • Status changed from closed to reopened

It appears that this feature has regressed and new tabs are again impossible to create. Testing on Windows 10 in both Edge and Chrome, CTRL + click does not work and themes open in the current tab. The right-click context menu option still works.

#6 in reply to: ↑ 5 @jancbeck
9 years ago

Replying to mrwweb:

It appears that this feature has regressed and new tabs are again impossible to create. Testing on Windows 10 in both Edge and Chrome, CTRL + click does not work and themes open in the current tab. The right-click context menu option still works.

It is working for me on Mac+Chrome. Are we talking about browsing https://wordpress.org/themes/browse/popular/ ?

#7 @mrwweb
9 years ago

Yes. Also https://wordpress.org/themes/. Just tested in Firefox and CTRL + Click doesn't work there either.

#8 @Otto42
9 years ago

Confirmed that it does not work on Chrome + Windows 10.

I think this is because event.metaKey is unreliable, according to most sources I can find with a quick search.

Edit: Checking for event.ctrlKey as well should work, I think.

Last edited 9 years ago by Otto42 (previous) (diff)

#9 @Otto42
9 years ago

  • Resolution set to fixed
  • Status changed from reopened to closed

In 2450:

Add checking for event.ctrlKey as well, for Windows browsers that don't recognize ctrl as a metaKey. Fixes #844

Note: See TracTickets for help on using tickets.