Make WordPress Core

Opened 8 years ago

Closed 8 years ago

Last modified 8 years ago

#38502 closed defect (bug) (fixed)

Twenty Seventeen: Unnecessary l10n variables

Reported by: enodekciw's profile enodekciw Owned by: davidakennedy's profile davidakennedy
Milestone: 4.7 Priority: normal
Severity: normal Version: 4.7
Component: Bundled Theme Keywords: has-patch
Focuses: Cc:

Description (last modified by ocean90)


Since [38909], both

if ( 'true' === twentyseventeenScreenReaderText.has_navigation )

conditionals in /twentyseventeen/assets/js/global.js can be changed to

if ( $menuScrollDown.length )

which would also allow $twentyseventeen_l10n['has_navigation'] to be completely removed from functions.php

Attachments (2)

38502.patch (2.8 KB) - added by enodekciw 8 years ago.
38502.1.patch (3.9 KB) - added by laurelfulford 8 years ago.

Download all attachments as: .zip

Change History (13)

#1 @davidakennedy
8 years ago

  • Milestone changed from Awaiting Review to 4.7

#2 @davidakennedy
8 years ago

  • Keywords needs-patch added

This ticket was mentioned in Slack in #core by jeffpaul. View the logs.

8 years ago

#4 @ocean90
8 years ago

  • Description modified (diff)

This ticket was mentioned in Slack in #core by helen. View the logs.

8 years ago

#6 @davidakennedy
8 years ago

  • Type changed from enhancement to defect (bug)

#7 @enodekciw
8 years ago

Now that I had some time to catch up to recent code changes and dig deeper into this, seems that it might be a bit trickier to do this than I initially thought. Just changing the conditional doesn't make menu function as desired.

Decided to tinker with this tonight, attaching a patch. This is probably not the final version of the patch and will still need some tweaking, but might be something to work on.

Did some testing - works as intended (at least on my side).

Sorry, if I messed it up somehow - this is my first contribution using svn/trac.

P.S. I might not be able to update the patch myself, so feel free to take over.

8 years ago

#8 @davidakennedy
8 years ago

  • Keywords has-patch added; needs-patch removed

#9 @laurelfulford
8 years ago

@enodekciw your patch looked really good to me!

In 38502.1.patch I made two very minor formatting tweaks (removed a line break and an empty space at the end of one line.

I also added a fix for a issue that was noticed while testing - when there is no custom header image, the scroll down arrow should not appear next to the navigation on the front page. It should only be there when there's a big header.

#10 @davidakennedy
8 years ago

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

In 39073:

Twenty Seventeen: Remove unnecessary l10n variables

  • Relies on header skip link instead of l10n variables in JavaScript.
  • Fixes issue where scroll down arrow appeared next to the navigation on the front page with no header image or video. It now only appears with a big header.

Props enodekciw, laurelfulford.

Fixes #38502.

#11 @SergeyBiryukov
8 years ago

  • Summary changed from TwentySeventeen: unnecessary l10n variables to Twenty Seventeen: Unnecessary l10n variables
Note: See TracTickets for help on using tickets.