accurator/commit
Correct handling of adding cluster rows.
author | Chris Dijkshoorn |
---|---|
Wed Mar 23 09:59:34 2016 +0100 | |
committer | Chris Dijkshoorn |
Wed Mar 23 09:59:34 2016 +0100 | |
commit | 7a2655490d8a59ff4a328b854ed98ff5e80c62ff |
tree | 1a4a021e5fbe81ab46adc4eceedc0ef977b74454 |
parent | 158b37fa7e000a008becbfcfb0a283e4a3e6d9ee |
Diff style: patch stat
diff --git a/web/js/components/cluster.js b/web/js/components/cluster.js index a41332e..ed0cd56 100644 --- a/web/js/components/cluster.js +++ b/web/js/components/cluster.js @@ -18,7 +18,7 @@ Cluster.prototype.init = function() { } Cluster.prototype.html = function() { - return $.el.div({'class':'col-md-12 well well-sm', 'id':this.id}); + return $.el.div({'class':'well well-sm', 'id':this.id}); } Cluster.prototype.enrich = function() { @@ -73,7 +73,8 @@ Cluster.prototype.addPagination = function(numberDisplayedItems) { ); // add event listener for change of page - $(this.node).on("pagination", function(event) { + console.log("adding listener to ", this.id); + $("#", this.id).on("pagination", function(event) { _cluster.changeThumbnails(event.currentPage, event.nextPage, numberDisplayedItems); }); } diff --git a/web/js/components/pagination.js b/web/js/components/pagination.js index c5a2a74..ea362bc 100644 --- a/web/js/components/pagination.js +++ b/web/js/components/pagination.js @@ -64,9 +64,8 @@ Pagination.prototype.html = function() { Pagination.prototype.addClickEvent = function(pageNode, i) { var _page = this; - console.log("add event to cluster ", _page.parentId, " go to ", i); + $(pageNode).on("click pagination", function() { - console.log("cluster ", _page.parentId, " go to ", i); _page.goToPage(i); }); } @@ -101,6 +100,7 @@ Pagination.prototype.goToPage = function(page) { var event = jQuery.Event("pagination"); event.currentPage = this.page; event.nextPage = page; + console.log("trigger event ", event); $("#" + this.parentId).trigger(event); // set active class to inactive diff --git a/web/js/results.js b/web/js/results.js index ad05f2a..22862ba 100644 --- a/web/js/results.js +++ b/web/js/results.js @@ -203,8 +203,7 @@ function drawRows(clusters) { if (display.layout === "cluster") { for (var i=0; i<clusters.length; i++) { $("#resultsDiv").append( - $.el.div({'class':'row', - 'id':clusters[i].id}) + clusters[i].node ); } } else if (display.layout === "list") {