Making WordPress.org

Changeset 11655


Ignore:
Timestamp:
03/09/2022 06:06:20 AM (3 years ago)
Author:
dd32
Message:

Plugin Directory: FAQ: Respect the scroll-padding-top when scrolling to opened FAQ entries.

See #6025.

Location:
sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-plugins
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-plugins/functions.php

    r11455 r11655  
    7474 */
    7575function scripts() {
    76     wp_enqueue_style( 'wporg-style', get_theme_file_uri( '/css/style.css' ), [ 'dashicons', 'open-sans' ], '20220118' );
     76    wp_enqueue_style( 'wporg-style', get_theme_file_uri( '/css/style.css' ), [ 'dashicons', 'open-sans' ], filemtime( __DIR__ . '/css/style.css' ) );
    7777    wp_style_add_data( 'wporg-style', 'rtl', 'replace' );
    7878
     
    8787    if ( is_singular( 'plugin' ) ) {
    8888        wp_enqueue_script( 'wporg-plugins-popover', get_stylesheet_directory_uri() . '/js/popover.js', array( 'jquery' ), '20171002', true );
    89         wp_enqueue_script( 'wporg-plugins-faq', get_stylesheet_directory_uri() . '/js/section-faq.js', array( 'jquery' ), '20200120', true );
     89        wp_enqueue_script( 'wporg-plugins-faq', get_stylesheet_directory_uri() . '/js/section-faq.js', array( 'jquery' ), filemtime( __DIR__ . '/js/section-faq.js' ), true );
    9090    }
    9191
  • sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-plugins/js/section-faq.js

    r10606 r11655  
    3838
    3939            if ( window.location.hash ) {
    40                 window.scrollTo( 0, $question.offset().top );
     40                var scrollPaddingTop = parseInt( $('html').css('scroll-padding-top') || 0 );
     41
     42                window.scrollTo( 0, $question.offset().top - scrollPaddingTop );
    4143            }
    4244        } );
Note: See TracChangeset for help on using the changeset viewer.