Make WordPress Core

Ticket #27220: 27220.2.diff

File 27220.2.diff, 1.3 KB (added by lancewillett, 12 years ago)

Better use of JS variable, remove extra parens, bump JS file version

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

     
    256256                ) );
    257257        }
    258258
    259         wp_enqueue_script( 'twentyfourteen-script', get_template_directory_uri() . '/js/functions.js', array( 'jquery' ), '20140319', true );
     259        wp_enqueue_script( 'twentyfourteen-script', get_template_directory_uri() . '/js/functions.js', array( 'jquery' ), '20140616', true );
    260260}
    261261add_action( 'wp_enqueue_scripts', 'twentyfourteen_scripts' );
    262262
  • wp-content/themes/twentyfourteen/js/functions.js

     
    9494                                mastheadOffset = $( '#masthead' ).offset().top - toolbarOffset;
    9595
    9696                                _window.on( 'scroll.twentyfourteen', function() {
    97                                         if ( ( window.scrollY > mastheadOffset ) && ( mastheadHeight < 49 ) ) {
     97                                        if ( _window.scrollTop() > mastheadOffset && mastheadHeight < 49 ) {
    9898                                                body.addClass( 'masthead-fixed' );
    9999                                        } else {
    100100                                                body.removeClass( 'masthead-fixed' );