=== modified file 'dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/commons.js' --- dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/commons.js 2012-09-21 08:30:28 +0000 +++ dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/commons.js 2012-10-12 12:49:44 +0000 @@ -40,6 +40,37 @@ } /** + * Scrolls the view port to the bottom of the document. + */ +function scrollToBottom() +{ + var scrollTop = parseInt( $( document ).height() - $( window ).height() ); + + if ( scrollIsRelevant() ) + { + $( document ).scrollTop( scrollTop ); + } +} + +/** + * Scrolls the view port to the top of the document. + */ +function scrollToTop() +{ + $( document ).scrollTop( 0 ); +} + +/** + * Indicates whether there is a need for scrolling. + */ +function scrollIsRelevant() +{ + var scrollTop = parseInt( $( document ).height() - $( window ).height() ); + var relevant = ( scrollTop > 0 ); + return relevant; +} + +/** * Joins the names of the given array of objects and returns it as a single string. */ function joinNameableObjects( objects ) === modified file 'dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/resources/org/hisp/dhis/dashboard/i18n_module.properties' --- dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/resources/org/hisp/dhis/dashboard/i18n_module.properties 2012-10-11 19:54:10 +0000 +++ dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/resources/org/hisp/dhis/dashboard/i18n_module.properties 2012-10-12 12:49:44 +0000 @@ -83,4 +83,6 @@ follow_up=Follow up unread=Unread send_message=Send message -to=to \ No newline at end of file +to=to +scroll_down=Scroll down +scroll_up=Scroll up \ No newline at end of file === modified file 'dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/webapp/dhis-web-dashboard-integration/readMessage.vm' --- dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/webapp/dhis-web-dashboard-integration/readMessage.vm 2012-10-07 19:07:53 +0000 +++ dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/webapp/dhis-web-dashboard-integration/readMessage.vm 2012-10-12 12:49:44 +0000 @@ -1,6 +1,10 @@