dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #19306
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 8359: Adjusted interpretation auto-scroll
------------------------------------------------------------
revno: 8359
committer: Lars Helge Øverland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Wed 2012-10-03 10:51:03 +0200
message:
Adjusted interpretation auto-scroll
modified:
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/webapp/dhis-web-dashboard-integration/javascript/interpretation.js
--
lp:dhis2
https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk
Your team DHIS 2 developers is subscribed to branch lp:dhis2.
To unsubscribe from this branch go to https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk/+edit-subscription
=== 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();
}