diff --git wp-admin/includes/class-wp-list-table.php wp-admin/includes/class-wp-list-table.php
index 39a18b3..1f15946 100644
|
|
class WP_List_Table { |
483 | 483 | $disable_first = $disable_last = ''; |
484 | 484 | if ( $current == 1 ) |
485 | 485 | $disable_first = ' disabled'; |
486 | | if ( $current == $total_items ) |
| 486 | if ( $current == $total_pages ) |
487 | 487 | $disable_last = ' disabled'; |
488 | 488 | |
489 | 489 | $page_links[] = sprintf( "<a class='%s' title='%s' href='%s'>%s</a>", |
diff --git wp-admin/js/list-table.dev.js wp-admin/js/list-table.dev.js
index 7144e48..efa38e0 100644
|
|
window.listTable = { |
91 | 91 | if ( 'object' != typeof response ) { |
92 | 92 | this.handle_error(); |
93 | 93 | } else { |
94 | | var tablenav = $('.tablenav-pages'); |
| 94 | var tablenav = $('.tablenav-pages'), current = $.query.GET('paged'), total = response.total_pages; |
95 | 95 | |
96 | 96 | this.stop_loading(); |
97 | 97 | |
… |
… |
window.listTable = { |
102 | 102 | $('.displaying-num').html(response.total_items_i18n); |
103 | 103 | $('.total-pages').html(response.total_pages_i18n); |
104 | 104 | |
105 | | this.set_total_pages(response.total_pages); |
| 105 | this.set_total_pages(total); |
106 | 106 | |
107 | 107 | if ( response.total_pages > 1 ) |
108 | 108 | tablenav.removeClass('one-page'); |
109 | 109 | |
110 | | $('.current-page').val($.query.GET('paged')); |
| 110 | $('.current-page').val(current); |
111 | 111 | |
112 | 112 | // Disable buttons that should noop. |
113 | | tablenav.find('.first-page, .prev-page').toggleClass('disabled', 1 == $.query.GET('paged')); |
114 | | tablenav.find('.next-page, .last-page').toggleClass('disabled', response.total_pages_i18n == $.query.GET('paged')); |
| 113 | tablenav.find('.first-page, .prev-page').toggleClass('disabled', 1 == current); |
| 114 | tablenav.find('.next-page, .last-page').toggleClass('disabled', total == $.query.GET('paged')); |
| 115 | |
| 116 | // update href attributes of enabled buttons |
| 117 | tablenav. |
| 118 | find('.next-page:not(.disabled)').attr('href', $.query.set('paged', current + 1).toString()).end(). |
| 119 | find('.prev-page:not(.disabled)').attr('href', $.query.set('paged', current - 1).toString()).end(). |
| 120 | find('.last-page:not(.disabled)').attr('href', $.query.set('paged', total).toString()); |
115 | 121 | |
116 | 122 | $('th.column-cb :input').attr('checked', false); |
117 | 123 | |
… |
… |
listTable.init(); |
160 | 166 | listTable.update_rows({'paged': paged}, false, function() { |
161 | 167 | if ( $el.parents('.tablenav.bottom').length ) |
162 | 168 | scrollTo(0, 0); |
163 | | |
| 169 | |
164 | 170 | $(listTable).trigger('changePage'); |
165 | 171 | }); |
166 | 172 | } |