Skip to content
Browse files

do not paginate on search

  • Loading branch information...
1 parent c324adf commit 177ac0c0003d7879f7080ddab3f3b13e360806cb obfuscurity committed Aug 2, 2012
Showing with 5 additions and 3 deletions.
  1. +5 −3 lib/descartes/public/js/render-graph.js
View
8 lib/descartes/public/js/render-graph.js
@@ -29,7 +29,6 @@ var renderGraphs = function() {
$('div.graphs').append('<div class="row"></div>');
}
row = myRowIndex + Math.floor( i / myColumns );
- console.log(row);
var spanSize = ( 12 / myColumns );
$($('div.graphs div.row')[row]).append('<span id="' + d[i].uuid + '" class="graph span' + spanSize + '"></div>');
var myGraphWidth = $($('div.row span.graph')[0]).width();
@@ -49,8 +48,11 @@ var renderGraphs = function() {
// Paginate when we hit the bottom of the page
$(window).scroll(function() {
- if($(window).scrollTop() + $(window).height() == $(document).height()) {
- if (myPageIndex > 0) {
+ // Do not paginate under the following conditions:
+ // * we're already at the end of the document (myPageIndex === 0)
+ // * we're searching on tags (myTags.length > 0)
+ if ((myPageIndex > 0) && (myTags.length === 0)) {
+ if ($(window).scrollTop() + $(window).height() == $(document).height()) {
myPageIndex += 1;
myRowIndex += 1;
renderGraphs();

0 comments on commit 177ac0c

Please sign in to comment.
Something went wrong with that request. Please try again.