Differentiate between localized and raw total pages. See #14579

git-svn-id: https://develop.svn.wordpress.org/trunk@16429 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
scribu
2010-11-17 17:03:27 +00:00
parent 862dabded8
commit 5705b3ca9c
4 changed files with 12 additions and 10 deletions
+6 -6
View File
@@ -22,8 +22,8 @@ window.listTable = {
},
// paging
set_total_pages: function() {
this.total_pages = parseInt($('.total-pages').eq(0).text());
set_total_pages: function(num) {
this.total_pages = num || $.query.load( $('.last-page').attr('href') ).get('paged');
},
get_total_pages: function() {
@@ -31,7 +31,7 @@ window.listTable = {
},
change_page: function(paged) {
if ( paged < 1 || paged >this.total_pages )
if ( paged < 1 || paged > this.total_pages )
return false;
this.update_rows({'paged': paged});
@@ -104,10 +104,10 @@ window.listTable = {
this.$tbody.html(response.rows);
$('.displaying-num').html(response.total_items);
$('.displaying-num').html(response.total_items_i18n);
$('.total-pages').html(response.total_pages_i18n);
$('.total-pages').html(response.total_pages);
this.set_total_pages();
this.set_total_pages(response.total_pages);
$('.current-page').val($.query.GET('paged'));