WordPress.org

Making WordPress.org

Opened 6 years ago

Closed 6 years ago

#159 closed defect (fixed)

Clicking left or right sides of the Download WordPress button does nothing, or results in 404

Reported by: rosshanney Owned by: coffee2code
Milestone: Priority: low
Component: General Keywords: has-patch
Cc:

Description

This refers to the big blue button on the top right of WordPress.org pages.

On the wordpress.org homepage, clicking the areas of the button to the left or right of the "Download WordPress" text result in the browser navigating to wordpress.org/undefined, which 404s.

On other pages / areas (codex, forums, themes, plugins etc.), doing the same doesn't result in a 404, but nothing else happens either (it doesn't take you to wordpress.org/download, as it should).

The attached screenshot shows that the <a> element is not as wide as the styled button area.

Attachments (2)

download-wordpress-button.png (19.1 KB) - added by rosshanney 6 years ago.
meta-159.patch (562 bytes) - added by SergeyBiryukov 6 years ago.

Download all attachments as: .zip

Change History (8)

#1 @SergeyBiryukov
6 years ago

Confirmed.

"undefined" comes from recordOutboundLink()

function recordOutboundLink(link, category, action) {
	_gaq.push(['_trackEvent', category, action])
	setTimeout('document.location = "' + link.href + '"', 100);
}

It's called when clicking on both the <a> and <li> tags:

$('#download a, .download-button').click(function() {
	recordOutboundLink(this, 'Download Links', $(this).hasClass('download-button') ? 'button' : 'nav' );
	return false;
});

However, it doesn't take into account that <li> doesn't have an href attribute.

#2 @SergeyBiryukov
6 years ago

  • Keywords has-patch added

Changing .download-button to a.download-button should fix it:

$('#download a, a.download-button').click(function() {
	recordOutboundLink(this, 'Download Links', $(this).hasClass('download-button') ? 'button' : 'nav' );
	return false;
});

Additionally, meta-159.patch makes the link as wide as the <li> element.

#3 follow-up: @coffee2code
6 years ago

  • Owner set to coffee2code
  • Status changed from new to accepted

The 'download-button' class is assigned to the li, so the JS fix will have to be:

$('#download a, .download-button a').click(function() {
	recordOutboundLink(this, 'Download Links', $(this).hasClass('download-button') ? 'button' : 'nav' );
	return false;
});

#4 @coffee2code
6 years ago

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

In 94:

Fix internal padding of 'Download WordPress' button in header so the link fills entire button area. props SergeyBiryukov. Fixes #159.

#5 in reply to: ↑ 3 @SergeyBiryukov
6 years ago

  • Resolution fixed deleted
  • Status changed from closed to reopened

Replying to coffee2code:

The 'download-button' class is assigned to the li, so the JS fix will have to be:

Yes, but the second selector was for the button next to "Ready to get started?", not for the one in header (which is handled by the first selector).

The current selectors are redundant and only catch the button in header.

#6 @coffee2code
6 years ago

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

Fixed.

You're right. I didn't realize you were addressing the second download button on the page or that the class appeared again but assigned to a different type of tag.

Note: See TracTickets for help on using tickets.