Skip to content
This repository has been archived by the owner. It is now read-only.

This fixes multiple js errors #753

Closed
wants to merge 4 commits into from
Closed
Changes from all commits
Commits
File filter...
Filter file types
Jump to…
Jump to file or symbol
Failed to load files and symbols.

Always

Just for now

@@ -222,8 +222,8 @@ function twentynineteen_scripts() {
wp_style_add_data( 'twentynineteen-style', 'rtl', 'replace' );
if ( has_nav_menu( 'menu-1' ) ) {
wp_enqueue_script( 'twentynineteen-priority-menu', get_theme_file_uri( '/js/priority-menu.js' ), array(), '1.0', true );
wp_enqueue_script( 'twentynineteen-touch-navigation', get_theme_file_uri( '/js/touch-keyboard-navigation.js' ), array(), '1.0', true );
wp_enqueue_script( 'twentynineteen-priority-menu', get_theme_file_uri( '/js/priority-menu.js' ), array(), '1.1', true );
wp_enqueue_script( 'twentynineteen-c', get_theme_file_uri( '/js/touch-keyboard-navigation.js' ), array(), '1.1', true );
}
wp_enqueue_style( 'twentynineteen-print-style', get_template_directory_uri() . '/print.css', array(), wp_get_theme()->get( 'Version' ), 'print' );
@@ -117,8 +117,15 @@

// Adds the necessary UI to operate the menu.
var visibleList = container.parentNode.querySelector('.main-menu[id]');
var hiddenList = visibleList.parentNode.nextElementSibling.querySelector('.hidden-links');
var toggleButton = visibleList.parentNode.nextElementSibling.querySelector('.main-menu-more-toggle');

var nextElementSibling = visibleList.parentNode.nextElementSibling;

if ( ! nextElementSibling ) {
return;
}

var hiddenList = nextElementSibling.querySelector('.hidden-links');
var toggleButton = nextElementSibling.querySelector('.main-menu-more-toggle');

if ( isOverflowingNavivation( visibleList, toggleButton, container ) ) {

@@ -287,6 +287,11 @@
// Remove Focused elements in sibling div
var currentDiv = getCurrentParent( event.target, 'div', '.main-navigation' );
var currentDivSibling = currentDiv.previousElementSibling === null ? currentDiv.nextElementSibling : currentDiv.previousElementSibling;

if ( ! currentDivSibling ) {
return;
}

var focusedElement = currentDivSibling.querySelector( '.is-focused' );
var focusedClass = 'is-focused';
var prevLi = getCurrentParent( event.target, '.main-navigation > div > ul > li', '.main-navigation' ).previousElementSibling;
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.