diff --git wordpress.org/public_html/wp-content/themes/pub/wporg-themes/css/components/_main.scss wordpress.org/public_html/wp-content/themes/pub/wporg-themes/css/components/_main.scss
index 032595b7d..db8bc4c97 100644
|
|
ul, ol { |
166 | 166 | opacity: 1; |
167 | 167 | } |
168 | 168 | |
| 169 | .theme-load-more { |
| 170 | text-align: center; |
| 171 | } |
| 172 | |
169 | 173 | // Theme Widget area in the themes screen. |
170 | 174 | .theme-widget-area { |
171 | 175 | background-color: #fff; |
diff --git wordpress.org/public_html/wp-content/themes/pub/wporg-themes/index.php wordpress.org/public_html/wp-content/themes/pub/wporg-themes/index.php
index a390a9a9d..5ea591904 100644
|
|
get_header(); |
21 | 21 | </div> |
22 | 22 | |
23 | 23 | <ul class="filter-links"> |
24 | | <?php /* <li><a href="<?php echo esc_url( home_url( 'browse/featured/' ) ); ?>" data-sort="featured" <?php if ( (is_front_page() && !get_query_var('browse') ) || 'featured' == get_query_var('browse') ) { echo 'class="current"'; } ?>><?php _ex( 'Featured', 'themes', 'wporg-themes' ); ?></a></li> */ ?> |
25 | 24 | <li><a href="<?php echo esc_url( home_url( '/' ) ); ?>" data-sort="popular" <?php if ( (is_front_page() && !get_query_var('browse') ) || 'popular' == get_query_var('browse') ) { echo 'class="current"'; } ?>><?php _ex( 'Popular', 'themes', 'wporg-themes' ); ?></a></li> |
26 | 25 | <li><a href="<?php echo esc_url( home_url( 'browse/new/' ) ); ?>" data-sort="new" <?php if ( 'new' == get_query_var('browse') ) { echo 'class="current"'; } ?>><?php _ex( 'Latest', 'themes', 'wporg-themes' ); ?></a></li> |
27 | 26 | <?php if ( is_user_logged_in() ) { ?> |
… |
… |
get_header(); |
90 | 89 | <?php /* TODO: Don't display this for no-js queries where $wp_query->post_count > 0, but JS needs it too. */ ?> |
91 | 90 | <p class="no-themes"><?php _e( 'No themes found. Try a different search.', 'wporg-themes' ); ?></p> |
92 | 91 | </div> |
| 92 | <div class="theme-load-more"> |
| 93 | <button class="button button-primary button-large js-load-more-themes"><?php esc_html_e( 'Load more themes', 'wporg-themes' ); ?></button> |
| 94 | </div> |
93 | 95 | <div class="theme-install-overlay"></div> |
94 | 96 | <div class="theme-overlay"></div> |
95 | 97 | <span class="spinner"></span> |
diff --git wordpress.org/public_html/wp-content/themes/pub/wporg-themes/js/theme.js wordpress.org/public_html/wp-content/themes/pub/wporg-themes/js/theme.js
index fa4dada5a..73f55923a 100644
|
|
window.wp = window.wp || {}; |
74 | 74 | |
75 | 75 | // Sets up a throttler for binding to 'scroll' |
76 | 76 | initialize: function( options ) { |
77 | | // Scroller checks how far the scroll position is |
78 | | _.bindAll( this, 'scroller' ); |
| 77 | _.bindAll( this, 'loadMoreThemes' ); |
79 | 78 | |
80 | 79 | this.SearchView = options.SearchView ? options.SearchView : themes.view.Search; |
81 | | // Bind to the scroll event and throttle |
82 | | // the results from this.scroller |
83 | | this.window.bind( 'scroll', _.throttle( this.scroller, 300 ) ); |
| 80 | |
| 81 | $('.js-load-more-themes').bind( 'click', this.loadMoreThemes ); |
84 | 82 | }, |
85 | 83 | |
86 | 84 | // Main render control |
… |
… |
window.wp = window.wp || {}; |
122 | 120 | .append( view.el ); |
123 | 121 | }, |
124 | 122 | |
125 | | // Checks when the user gets close to the bottom |
126 | | // of the mage and triggers a theme:scroll event |
127 | | scroller: function() { |
128 | | var self = this, |
129 | | bottom, threshold; |
130 | | |
131 | | bottom = this.window.scrollTop() + self.window.height(); |
132 | | threshold = self.$el.offset().top + self.$el.outerHeight( false ) - self.window.height(); |
133 | | threshold = Math.round( threshold * 0.9 ); |
134 | | |
135 | | if ( bottom > threshold ) { |
136 | | this.trigger( 'theme:scroll' ); |
137 | | } |
138 | | } |
| 123 | // Trigger loading additional themes |
| 124 | loadMoreThemes: function () { |
| 125 | this.trigger( 'theme:loadMore' ); |
| 126 | }, |
139 | 127 | }); |
140 | 128 | |
141 | 129 | // Set up the Collection for our theme data |
… |
… |
window.wp = window.wp || {}; |
1036 | 1024 | $( 'body' ).addClass( 'no-results' ); |
1037 | 1025 | }); |
1038 | 1026 | |
1039 | | this.listenTo( this.parent, 'theme:scroll', function() { |
| 1027 | this.listenTo( this.parent, 'theme:loadMore', function() { |
1040 | 1028 | self.renderThemes( self.parent.page ); |
1041 | 1029 | }); |
1042 | 1030 | |