From 379d9ce1f7cdb9b8971e295abc4ac0573a96c798 Mon Sep 17 00:00:00 2001 From: nac26 Date: Mon, 31 Jan 2011 04:03:32 +0000 Subject: [PATCH] NIHVIVO-1948 Pulled pagination out into its own function so it can be called by the default file and any product extension. Also introduced scrolling to getIndividuals(). Not sure if we'll keep this. --- webapp/web/js/menupage/browseByVClass.js | 72 ++++++++++++++---------- 1 file changed, 42 insertions(+), 30 deletions(-) diff --git a/webapp/web/js/menupage/browseByVClass.js b/webapp/web/js/menupage/browseByVClass.js index 7bd7ac95f..9f1830051 100644 --- a/webapp/web/js/menupage/browseByVClass.js +++ b/webapp/web/js/menupage/browseByVClass.js @@ -68,12 +68,12 @@ var browseByVClass = { // Load individuals for default class as specified by menupage template defaultVClass: function() { if ( this.defaultBrowseVClassURI != "false" ) { - this.getIndividuals(this.defaultBrowseVClassUri); + this.getIndividuals(this.defaultBrowseVClassUri, "all", 1, false); } }, // Where all the magic happens -- gonna fetch me some individuals - getIndividuals: function(vclassUri, alpha, page) { + getIndividuals: function(vclassUri, alpha, page, scroll) { url = this.dataServiceUrl + encodeURIComponent(vclassUri); if ( alpha && alpha != "all") { url += '&alpha=' + alpha; @@ -83,6 +83,9 @@ var browseByVClass = { } else { page = 1; } + if ( typeof scroll === "undefined" ) { + scroll = true; + } // First wipe currently displayed individuals and existing pagination this.individualsInVClass.empty(); @@ -92,34 +95,7 @@ var browseByVClass = { // Check to see if we're dealing with pagination if ( results.pages.length ) { pages = results.pages; - - pagination = '