| @@ -117,13 +117,17 @@ | ||
| 117 | 117 | |
| 118 | 118 | <!-- Children topics. --> |
| 119 | 119 | <?php include __DIR__ . '/admin_ui/topics.php'; ?> |
| 120 | 120 | |
| 121 | - <?php if ( $children->post_count > 0 ) : ?> | |
| 122 | - <div class="controls bbpc-admin-pagination" style="display:none;"> | |
| 121 | + <?php | |
| 122 | + if ( $children->post_count > 10 ) : | |
| 123 | + ?> | |
| 124 | + <div class="controls bbpc-admin-pagination"> | |
| 123 | 125 | <div class="mixitup-control mixitup-page-list"></div> |
| 124 | 126 | </div> |
| 125 | - <?php endif; ?> | |
| 127 | + <?php | |
| 128 | + endif; | |
| 129 | + ?> | |
| 126 | 130 | |
| 127 | 131 | <a class="easydocs-btn easydocs-btn-outline-blue easydocs-btn-sm easydocs-btn-round button button-info section-doc" id="bbpc-topic" target="_blank" name="submit" href="javascript:void(0)" bbp_forum_id="<?php echo esc_attr( $item ); ?>"> |
| 128 | 132 | <?php esc_html_e( 'Add Topic', 'forumax' ); ?> |
| 129 | 133 | </a> |
| @@ -180,16 +184,13 @@ | ||
| 180 | 184 | callbacks: { |
| 181 | 185 | onMixEnd: function(state) { |
| 182 | 186 | var pagination = state.container.querySelector('.bbpc-admin-pagination'); |
| 183 | 187 | if ( pagination ) { |
| 184 | - // Count matching items directly from the DOM using the active | |
| 185 | - // filter selector. MixItUp always renders prev/next buttons so | |
| 186 | - // children.length is unreliable for detecting multi-page results. | |
| 187 | - var selector = state.activeFilter ? state.activeFilter.selector : ''; | |
| 188 | - var matchCount = ( ! selector || selector === 'all' ) | |
| 189 | - ? state.container.querySelectorAll('.mix').length | |
| 190 | - : state.container.querySelectorAll(selector).length; | |
| 191 | - pagination.style.display = matchCount > 10 ? 'block' : 'none'; | |
| 188 | + if ( state.totalShow === 0 ) { | |
| 189 | + pagination.style.display = 'none'; | |
| 190 | + } else { | |
| 191 | + pagination.style.display = 'block'; | |
| 192 | + } | |
| 192 | 193 | } |
| 193 | 194 | } |
| 194 | 195 | } |
| 195 | 196 | }; |