WordPress.org

Make WordPress Core

Opened 4 years ago

Closed 4 years ago

Last modified 4 years ago

#38502 closed defect (bug) (fixed)

Twenty Seventeen: Unnecessary l10n variables

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

Description (last modified by ocean90)

Hey,

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 4 years ago.
38502.1.patch (3.9 KB) - added by laurelfulford 4 years ago.

Download all attachments as: .zip

Change History (13)

#1 @davidakennedy
4 years ago

  • Milestone changed from Awaiting Review to 4.7

#2 @davidakennedy
4 years ago

  • Keywords needs-patch added

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


4 years ago

#4 @ocean90
4 years ago

  • Description modified (diff)

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


4 years ago

#6 @davidakennedy
4 years ago

  • Type changed from enhancement to defect (bug)

#7 @enodekciw
4 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.

@enodekciw
4 years ago

#8 @davidakennedy
4 years ago

  • Keywords has-patch added; needs-patch removed

#9 @laurelfulford
4 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
4 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
4 years ago

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