Plugin AP List: Update current page number if total page name updated to lower than current page number.

This commit is contained in:
Xelio 2013-03-26 02:20:46 +08:00
parent 6897da0cb8
commit 8f9049fdf3

View File

@ -335,6 +335,7 @@ window.plugin.apList.handleDestroyPortal = function() {
window.plugin.apList.updateTotalPages = function() { window.plugin.apList.updateTotalPages = function() {
$.each(plugin.apList.sortedPortals, function(side, portals) { $.each(plugin.apList.sortedPortals, function(side, portals) {
plugin.apList.totalPage[side] = Math.max(Math.ceil(portals.length / plugin.apList.portalPerPage), 1); plugin.apList.totalPage[side] = Math.max(Math.ceil(portals.length / plugin.apList.portalPerPage), 1);
plugin.apList.currentPage[side] = Math.min(plugin.apList.totalPage[side], plugin.apList.currentPage[side]);
}); });
} }