Make WordPress Core

Ticket #30056: 30056.diff

File 30056.diff, 2.0 KB (added by iamtakashi, 9 years ago)

Independent JS check inside head to avoid flashing child menus.

  • wp-content/themes/twentyfifteen/functions.php

     
    207207        wp_enqueue_style( 'twentyfifteen-ie7', get_template_directory_uri() . '/css/ie7.css', array( 'twentyfifteen-style' ), '20141010' );
    208208        wp_style_add_data( 'twentyfifteen-ie7', 'conditional', 'lt IE 8' );
    209209
     210        wp_enqueue_script( 'twentyfifteen-js-check', get_template_directory_uri() . '/js/js-check.js', array(), '20141024', false );
     211
    210212        wp_enqueue_script( 'twentyfifteen-skip-link-focus-fix', get_template_directory_uri() . '/js/skip-link-focus-fix.js', array(), '20141010', true );
    211213
    212214        if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) {
  • wp-content/themes/twentyfifteen/js/functions.js

     
    66 */
    77
    88( function( $ ) {
    9         $( 'html' ).removeClass( 'no-js' );
    10 
    119        // Add dropdown toggle that display child menu items.
    1210        $( '.main-navigation .page_item_has_children > a, .main-navigation .menu-item-has-children > a' ).append( '<button class="dropdown-toggle" aria-expanded="false">' + screenReaderText.expand + '</button>' );
    1311
  • wp-content/themes/twentyfifteen/js/js-check.js

     
     1( function() {
     2        document.documentElement.className = document.documentElement.className.replace( 'no-js', 'js' );
     3} )();
     4 No newline at end of file