Making WordPress.org


Ignore:
Timestamp:
02/18/2017 02:27:48 PM (8 years ago)
Author:
ocean90
Message:

Translate: Update styling of front page and main navigation.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-customizations/templates/helper-functions.php

    r4178 r4924  
    2525    return $locations;
    2626}, 50, 4 );
     27
     28function wporg_gp_is_index() {
     29    return GP::$current_route instanceof \WordPressdotorg\GlotPress\Routes\Routes\Index;
     30}
     31
     32/**
     33 * Prints JavaScript helper for menu toggle.
     34 */
     35add_action( 'gp_footer', function() {
     36    ?>
     37    <script>
     38        ( function( $ ) {
     39            $( function() {
     40                var $menu = $( '#site-navigation' );
     41
     42                if ( $menu.length ) {
     43                    $menu.find( 'button' ).on( 'click', function() {
     44                        $menu.toggleClass( 'toggled' );
     45                    } );
     46                }
     47            } );
     48        } )( jQuery );
     49    </script>
     50    <?php
     51} );
Note: See TracChangeset for help on using the changeset viewer.