=== modified file 'dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/java/org/hisp/dhis/dashboard/interpretation/action/GetInterpretationsAction.java' --- dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/java/org/hisp/dhis/dashboard/interpretation/action/GetInterpretationsAction.java 2012-09-30 20:23:50 +0000 +++ dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/java/org/hisp/dhis/dashboard/interpretation/action/GetInterpretationsAction.java 2012-10-03 08:51:03 +0000 @@ -40,7 +40,7 @@ public class GetInterpretationsAction implements Action { - private static final int PAGE_SIZE = 6; + private static final int PAGE_SIZE = 5; // ------------------------------------------------------------------------- // Dependencies === modified file 'dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/webapp/dhis-web-dashboard-integration/javascript/interpretation.js' --- dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/webapp/dhis-web-dashboard-integration/javascript/interpretation.js 2012-09-30 20:23:50 +0000 +++ dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/webapp/dhis-web-dashboard-integration/javascript/interpretation.js 2012-10-03 08:51:03 +0000 @@ -15,11 +15,14 @@ function isNextPage() { var fromTop = $( document ).scrollTop(); - var height = $( document ).height(); - var threshold = 0.7; - var loaded = parseFloat( parseFloat( fromTop ) / parseFloat( height ) ); - - if ( loaded >= threshold ) + var docHeight = $( document ).height(); + var windowHeight = $( window ).height(); + var threshold = parseInt( 350 ); + var remaining = parseInt( docHeight - ( fromTop + windowHeight ) ); + + log("--");log(fromTop);log(docHeight);log(windowHeight);log(remaining); + + if ( remaining < threshold ) { loadNextPage(); }