From bac2011271675e8b0233bbb996a10bb79c8be49f Mon Sep 17 00:00:00 2001 From: nac26 Date: Wed, 26 Jan 2011 14:33:13 +0000 Subject: [PATCH] NIHVIVO-1073 Pagination for browsing individuals --- .../js/menupage/browseByVClassPeople.js | 55 +++++++++++++++++-- 1 file changed, 50 insertions(+), 5 deletions(-) diff --git a/productMods/js/menupage/browseByVClassPeople.js b/productMods/js/menupage/browseByVClassPeople.js index 3ab4e5cb..5920dab4 100644 --- a/productMods/js/menupage/browseByVClassPeople.js +++ b/productMods/js/menupage/browseByVClassPeople.js @@ -6,17 +6,56 @@ var getPersonIndividuals = browseByVClass.getIndividuals; // Assigning the proxy function -browseByVClass.getIndividuals = function(vclassUri, alpha) { - // alert("This is the mothership!"); +browseByVClass.getIndividuals = function(vclassUri, alpha, page) { url = this.dataServiceUrl + encodeURIComponent(vclassUri); if ( alpha && alpha != "all") { url = url + '&alpha=' + alpha; } + if ( page ) { + url += '&page=' + page; + } else { + page = 1; + } - // First wipe currently displayed individuals + // First wipe currently displayed individuals and existing pagination this.individualsInVClass.empty(); + $('nav.pagination').remove(); $.getJSON(url, function(results) { + // Check to see if we're dealing with pagination + if ( results.pages.length ) { + pages = results.pages; + + pagination = '