From: Jakub Skoczen Date: Thu, 20 Jan 2011 15:33:34 +0000 (+0100) Subject: Fix paging by ensuring 'page' param is a number X-Git-Url: http://sru.miketaylor.org.uk/cgi-bin?a=commitdiff_plain;h=4cdc8af49704ea30676f4a7588457bbd4e83f411;p=mkdru-moved-to-drupal.org.git Fix paging by ensuring 'page' param is a number Otherwise the next button on page=1 will point to '11' and so on. --- diff --git a/mkdru.client.js b/mkdru.client.js index 2881fda..ebd713f 100644 --- a/mkdru.client.js +++ b/mkdru.client.js @@ -239,6 +239,10 @@ mkdru.limitTarget = function (id, name) { }; mkdru.generatePager = function () { + // make sure page param is a number, otherwise pageing frwd will be broken + if (typeof mkdru.state.page == "string") { + mkdru.state.page = Number(mkdru.state.page); + } var total = Math.ceil(mkdru.totalRec / mkdru.state.perpage); var first = (mkdru.state.page - mkdru.pagerRange > 0) ? mkdru.state.page - mkdru.pagerRange : 1;