Ticket #15503: 15503.5.diff
File 15503.5.diff, 1.8 KB (added by , 14 years ago) |
---|
-
wp-admin/js/list-table.dev.js
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 … … 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 if ( response.total_pages> 1 )107 if ( total > 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 == $.query.GET('paged'));113 tablenav.find('.first-page, .prev-page').toggleClass('disabled', 1 == current); 114 tablenav.find('.next-page, .last-page').toggleClass('disabled', total == current); 115 115 116 tablenav.find('.first-page').attr('href', $.query.set('paged', 1).toString()); 117 tablenav.find('.prev-page').attr('href', $.query.set('paged', 1 == current ? 1 : current-1).toString()); 118 tablenav.find('.next-page').attr('href', $.query.set('paged', total == current ? total : current+1).toString()); 119 tablenav.find('.last-page').attr('href', $.query.set('paged', total).toString()); 120 116 121 $('th.column-cb :input').attr('checked', false); 117 122 118 123 if ( history.replaceState ) {