WordPress.org

Making WordPress.org

Changeset 1312


Ignore:
Timestamp:
02/25/2015 12:18:00 AM (6 years ago)
Author:
obenland
Message:

WP.org Themes: Fall back to featured themes if there is no index history.

This can happen when a single theme was requested and the modal gets closed.

See #745.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-themes/js/theme.js

    r1311 r1312  
    471471        collapse: function( event ) {
    472472            var self = this,
     473                args = {},
    473474                scroll, search, tags, sorter;
    474475
     
    510511                    }
    511512                    else if ( sorter = $( '.filter-links .current' ) ) {
    512                         wp.themes.router.navigate( wp.themes.router.baseUrl( wp.themes.router.browsePath + sorter.data( 'sort' ) ) );
     513                        if ( ! sorter.length ) {
     514                            sorter = $( '.filter-links [data-sort="featured"]' );
     515                            args   = { trigger: true };
     516                        }
     517                        wp.themes.router.navigate( wp.themes.router.baseUrl( wp.themes.router.browsePath + sorter.data( 'sort' ) ), args );
    513518                        wp.themes.utils.title( sorter.text() );
    514519                    }
Note: See TracChangeset for help on using the changeset viewer.