From 8f9049fdf3d81e3897ecd40db447cc2d9d59b82e Mon Sep 17 00:00:00 2001 From: Xelio Date: Tue, 26 Mar 2013 02:20:46 +0800 Subject: [PATCH] Plugin AP List: Update current page number if total page name updated to lower than current page number. --- plugins/ap-list.user.js | 1 + 1 file changed, 1 insertion(+) diff --git a/plugins/ap-list.user.js b/plugins/ap-list.user.js index d1148c41..453eee5d 100644 --- a/plugins/ap-list.user.js +++ b/plugins/ap-list.user.js @@ -335,6 +335,7 @@ window.plugin.apList.handleDestroyPortal = function() { window.plugin.apList.updateTotalPages = function() { $.each(plugin.apList.sortedPortals, function(side, portals) { 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]); }); }