cluster_search_ui/commit

Replacing the correct id, restoring the pagination functionallity.

authorChris Dijkshoorn
Mon Mar 30 10:18:21 2015 +0100
committerChris Dijkshoorn
Mon Mar 30 10:18:21 2015 +0100
commitd34447df3e47dd9a31c07d87baced33624010ac5
tree0037f5ece3926763c2359cf65ba2744f417d986f
parentd7078f21635468da5cf17c97c24520435b47a56f
Diff style: patch stat
diff --git a/web/js/pagination.js b/web/js/pagination.js
index 70234ad..0d4359c 100644
--- a/web/js/pagination.js
+++ b/web/js/pagination.js
@@ -84,7 +84,7 @@ function goToPage(pageNumber, clusterId) {
 	// Get the number of list items of the pagination (translation: the number of pages)
 	var numberOfPages = $("#cluster" + clusterId + " .pagination li").length - 2;
 	var activePage = $("#cluster" + clusterId + " .pagination .active").text();
-//	console.log("Number of pages: " + numberOfPages + " Should be going to the " + pageNumber + " page now,  current activePAge: " + activePage);
+	console.log("Number of pages: " + numberOfPages + " Should be going to the " + pageNumber + " page now,  current activePAge: " + activePage);
 	changePagination(pageNumber, activePage, numberOfPages, clusterId);
 	changeThumbnails(pageNumber, activePage, numberOfPages, clusterId);
 }
\ No newline at end of file
diff --git a/web/js/thumbnail.js b/web/js/thumbnail.js
index 07fc0d4..480180a 100644
--- a/web/js/thumbnail.js
+++ b/web/js/thumbnail.js
@@ -57,11 +57,7 @@ function changeThumbnails(pageNumber, activePage, numberOfPages, clusterId) {
 	console.log("start: " + start + " stop: " + stop + " page number: " + pageNumber + " current page: " + activePage + " cluster id: " + clusterId + " displayed: " + displayOptions.numberDisplayedItems + " remove: " + remove);
 	var thumbIndex = 0;
 	for (i=start; i<stop; i++) {
-		// Replace id element and add new listener
-		id = getId(items[i].uri)
-		$("#cluster" + clusterId).eq(thumbIndex).attr("id", id);
-		addClickEvent(id, items[i].link, clusterId, i);
-		
+		console.log("Replacing thumb", thumbIndex);
 		// Replace image
 		$("#cluster" + clusterId + " img").eq(thumbIndex).replaceWith(
 			$.el.img({'src':items[i].thumb,
@@ -74,6 +70,11 @@ function changeThumbnails(pageNumber, activePage, numberOfPages, clusterId) {
 			headerType = "h4";
 		$("#cluster" + clusterId + " .caption " + headerType).eq(thumbIndex).replaceWith(
 				thumbnailTitle(i, items));
+		
+		// Replace id element and add new listener
+		id = getId(items[i].uri)
+		$("#cluster" + clusterId + " .thumbnail").eq(thumbIndex).attr("id", id);
+		addClickEvent(id, items[i].link, clusterId, i);
 		thumbIndex++;
 	}